laravel forupdate

DB::beginTransaction();

$goodsInfo  = Goods::where('seckill_goods_id',$gid)->lockForUpdate()->first();

$goodsInfo->seckill_stock-=1;

$goodsInfo->save();

DB::commit();

猜你喜欢

转载自blog.csdn.net/asdfegg/article/details/88052568
今日推荐