fixed cart

This commit is contained in:
Edward Yang 2022-06-28 21:10:52 +08:00
parent cf4dd8fb81
commit 9eea717441
1 changed files with 2 additions and 4 deletions

View File

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