From 8ed66a2e589f698592466bd116b6a5ca92c9227a Mon Sep 17 00:00:00 2001 From: Edward Yang Date: Tue, 28 Jun 2022 21:13:26 +0800 Subject: [PATCH] wip --- beike/Shop/Services/CartService.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/beike/Shop/Services/CartService.php b/beike/Shop/Services/CartService.php index 55980f82..f3ef72a1 100644 --- a/beike/Shop/Services/CartService.php +++ b/beike/Shop/Services/CartService.php @@ -80,11 +80,10 @@ class CartService */ public static function select($customer, $cartIds) { + Cart::query()->where('customer_id', $customer->id)->update(['selected' => 0]); if (empty($cartIds)) { return; } - Cart::query()->where('customer_id', $customer->id)->update(['selected' => 0]); - Cart::query()->where('customer_id', $customer->id) ->whereIn('id', $cartIds) ->update(['selected' => 1]);