We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EasySwoole版本:3.3.7 ORM版本:1.4.30 Dao <?php class V3OrderDao extends AbstractModel { protected $tableName = 'v3_order'; }
<?php class V3OrderDao extends AbstractModel { protected $tableName = 'v3_order'; }
Service $primaryKey = 202302141026000001;
// 场景1,可能有很多更新字段 $model1 = V3OrderDao::create()->where('order_id', $primaryKey)->get(); $model1->update(['updated_at' => time()]);
$model1 = V3OrderDao::create()->where('order_id', $primaryKey)->get(); $model1->update(['updated_at' => time()]);
// 场景2,可能有很多更新字段 $model2 = V3OrderDao::create()->get($primaryKey); $model2->updated_at = time(); $model2->update();
$model2 = V3OrderDao::create()->get($primaryKey); $model2->updated_at = time(); $model2->update();
// 场景3,可能有很多更新字段 V3OrderDao::create()->update(['updated_at' => time()], ['order_id' => $primaryKey]);
V3OrderDao::create()->update(['updated_at' => time()], ['order_id' => $primaryKey]);
// 场景4,可能有很多更新字段 V3OrderDao::create()->where('order_id', $primaryKey)->update();
V3OrderDao::create()->where('order_id', $primaryKey)->update();
实际的业务逻辑复杂,很难通过业务代码层面存更新的data和where。如何在模型的事件,例如onAfterUpdate()获取到更新的data以及条件where ?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
EasySwoole版本:3.3.7
ORM版本:1.4.30
Dao
<?php class V3OrderDao extends AbstractModel { protected $tableName = 'v3_order'; }
Service
$primaryKey = 202302141026000001;
// 场景1,可能有很多更新字段
$model1 = V3OrderDao::create()->where('order_id', $primaryKey)->get(); $model1->update(['updated_at' => time()]);
// 场景2,可能有很多更新字段
$model2 = V3OrderDao::create()->get($primaryKey); $model2->updated_at = time(); $model2->update();
// 场景3,可能有很多更新字段
V3OrderDao::create()->update(['updated_at' => time()], ['order_id' => $primaryKey]);
// 场景4,可能有很多更新字段
V3OrderDao::create()->where('order_id', $primaryKey)->update();
实际的业务逻辑复杂,很难通过业务代码层面存更新的data和where。如何在模型的事件,例如onAfterUpdate()获取到更新的data以及条件where ?
The text was updated successfully, but these errors were encountered: