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]);