From 9eea7174417d575c8efb4452b3fa4a81fb82fca1 Mon Sep 17 00:00:00 2001 From: Edward Yang Date: Tue, 28 Jun 2022 21:10:52 +0800 Subject: [PATCH] fixed cart --- beike/Shop/Services/CartService.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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]); }