diff --git a/beike/Shop/Services/CartService.php b/beike/Shop/Services/CartService.php index 89cc6ff1..55980f82 100644 --- a/beike/Shop/Services/CartService.php +++ b/beike/Shop/Services/CartService.php @@ -83,13 +83,11 @@ class CartService 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]); - - Cart::query()->where('customer_id', $customer->id) - ->whereNotIn('id', $cartIds) - ->update(['selected' => 0]); }