diff --git a/app/Listeners/CombinationGoodsStockUpdateListener.php b/app/Listeners/CombinationGoodsStockUpdateListener.php index a349a6a..80ea3b2 100644 --- a/app/Listeners/CombinationGoodsStockUpdateListener.php +++ b/app/Listeners/CombinationGoodsStockUpdateListener.php @@ -65,7 +65,7 @@ class CombinationGoodsStockUpdateListener implements ShouldQueue $num = !empty($event->num) ? $event->num : -1; foreach ($combinationGoods as $item) { DB::transaction(function () use ($item, &$updateIds, $num) { - $goodsSku = GoodsSku::query()->lockForUpdate()->find($item['item_id']); + $goodsSku = GoodsSku::query()->find($item['item_id']); $stock = $goodsSku->stock + $item['item_num'] * $num; //新增逻辑 在线库存同步扣减 $saleStock = max($goodsSku->sale_stock + $item['item_num'] * $num, 0);