From 226e5a7e9965815c3dda2e26862a263aa675fc76 Mon Sep 17 00:00:00 2001 From: Edward Yang Date: Mon, 22 Aug 2022 10:03:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=8B=E5=8D=95=E5=95=86?= =?UTF-8?q?=E5=93=81=E5=90=8D=E7=A7=B0=E8=A2=AB=E6=88=AA=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- beike/Shop/Http/Resources/CartDetail.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/beike/Shop/Http/Resources/CartDetail.php b/beike/Shop/Http/Resources/CartDetail.php index 829cc05d..3f675d20 100644 --- a/beike/Shop/Http/Resources/CartDetail.php +++ b/beike/Shop/Http/Resources/CartDetail.php @@ -21,6 +21,7 @@ class CartDetail extends JsonResource $product = $sku->product; $price = $sku->price; $description = $product->description; + $productName = $description->name; $subTotal = $price * $this->quantity; $image = $sku->image ?: $product->image; @@ -28,7 +29,8 @@ class CartDetail extends JsonResource 'cart_id' => $this->id, 'product_id' => $this->product_id, 'sku_id' => $this->product_sku_id, - 'name' => sub_string($description->name), + 'name' => $productName, + 'name_format' => sub_string($productName), 'image' => $image, 'image_url' => image_resize($image), 'quantity' => $this->quantity,