From d881e4e795fd12d581e547a584178e8fc3e45ffc Mon Sep 17 00:00:00 2001 From: TL Date: Fri, 12 Aug 2022 16:30:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B6=E8=97=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- beike/Shop/Http/Resources/ProductDetail.php | 2 +- beike/Shop/Http/Resources/ProductList.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/beike/Shop/Http/Resources/ProductDetail.php b/beike/Shop/Http/Resources/ProductDetail.php index cfe64d35..1f8cee89 100644 --- a/beike/Shop/Http/Resources/ProductDetail.php +++ b/beike/Shop/Http/Resources/ProductDetail.php @@ -35,7 +35,7 @@ class ProductDetail extends JsonResource 'category_id' => $this->category_id ?? null, 'variables' => $this->decodeVariables($this->variables), 'skus' => SkuDetail::collection($this->skus)->jsonSerialize(), - 'in_wishlist' => CustomerRepo::inWishlist($this->resource, current_customer()), + 'in_wishlist' => $this->inCurrentWishlist->id ?? 0, ]; } diff --git a/beike/Shop/Http/Resources/ProductList.php b/beike/Shop/Http/Resources/ProductList.php index 1f1e765f..e5a8d0e4 100644 --- a/beike/Shop/Http/Resources/ProductList.php +++ b/beike/Shop/Http/Resources/ProductList.php @@ -40,6 +40,7 @@ class ProductList extends JsonResource 'price_format' => currency_format($masterSku->price), 'origin_price_format' => currency_format($masterSku->origin_price), 'category_id' => $this->category_id ?? null, + 'in_wishlist' => $this->inCurrentWishlist->id ?? 0, 'images' => array_map(function ($item) { return image_resize($item, 400, 400);