From a5b7cb2bb8c472c2a06ff45f088e4f8bcb393233 Mon Sep 17 00:00:00 2001 From: Edward Yang Date: Tue, 28 Jun 2022 14:23:09 +0800 Subject: [PATCH] fixed cart list --- beike/Shop/Services/CartService.php | 3 +++ 1 file changed, 3 insertions(+) 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; }