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);