|

楼主 |
发表于 2020-8-12 19:00:28
|
显示全部楼层
laravel的是这样子的:
\DB::beginTransaction();
$talentBar = TalentBar::where('bar_id', $order->bar_id)->lockForUpdate()->first();
$talentBar->account_balance = $order->amount * $talentBar->fc_ratio + $talentBar->account_balance;
$talentBar->updated_at = $order->check_time;
$talentBar->saveOrFail();
\DB::commit(); //提交事务
==========================================
在ci4中找不到和“lockForUpdate”相同的加行锁的用法。 |
|