diff --git a/beike/Shop/Services/CartService.php b/beike/Shop/Services/CartService.php index 7f33c321..4ace1a50 100644 --- a/beike/Shop/Services/CartService.php +++ b/beike/Shop/Services/CartService.php @@ -19,6 +19,9 @@ class CartService { public static function list($customer) { + if (empty($customer)) { + return []; + } $cartList = Cart::query()->where('customer_id', $customer->id)->get(); return $cartList; }