From 6020642d0eff58fa59fb256958ba449c2dca1e0c Mon Sep 17 00:00:00 2001 From: weigang Date: Sun, 13 Sep 2020 17:13:58 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B4=AD=E7=89=A9=E8=BD=A6=E9=94=81=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Service/v3/Implementations/ShopCartUpdateService.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Service/v3/Implementations/ShopCartUpdateService.php b/app/Service/v3/Implementations/ShopCartUpdateService.php index 0c05168..7b69881 100644 --- a/app/Service/v3/Implementations/ShopCartUpdateService.php +++ b/app/Service/v3/Implementations/ShopCartUpdateService.php @@ -50,7 +50,7 @@ class ShopCartUpdateService implements ShopCartUpdateServiceInterface throw new ErrorCodeException($goodsCheck); } - return ShoppingCart::query()->updateOrCreate( + return ShoppingCart::query()->lockForUpdate()->updateOrCreate( [ 'user_id' => $userId, 'goods_id' => $goodsId,