From 3539d32cbc249cfe343bfd6a68022b8cd8f04ddb Mon Sep 17 00:00:00 2001 From: Edward Yang Date: Wed, 27 Jul 2022 16:59:21 +0800 Subject: [PATCH] fixed wish list --- beike/Repositories/CustomerRepo.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/beike/Repositories/CustomerRepo.php b/beike/Repositories/CustomerRepo.php index 4a91c287..48a5b92b 100644 --- a/beike/Repositories/CustomerRepo.php +++ b/beike/Repositories/CustomerRepo.php @@ -105,7 +105,7 @@ class CustomerRepo } /** - * @param $customer, Customer对象或id + * @param $customer , Customer对象或id * @param $productId * @return Customer|Builder|Builder[]|Collection|Model|mixed|null */ @@ -120,7 +120,7 @@ class CustomerRepo } /** - * @param $customer, Customer对象或id + * @param $customer , Customer对象或id * @param $productId * @return void */ @@ -144,12 +144,15 @@ class CustomerRepo } /** - * @param $product, 商品id或对象 - * @param $customer, 顾客id或对象 + * @param $product , 商品id或对象 + * @param $customer , 顾客id或对象 * @return int */ public static function inWishlist($product, $customer) { + if (!$customer) { + return false; + } if ($product instanceof Product) { $product = $product->id; }