diff --git a/beike/Models/ProductDescription.php b/beike/Models/ProductDescription.php
index 78c6f341..90bea26f 100644
--- a/beike/Models/ProductDescription.php
+++ b/beike/Models/ProductDescription.php
@@ -8,5 +8,5 @@ class ProductDescription extends Base
{
use HasFactory;
- protected $fillable = ['locale', 'name', 'content', 'meta_title', 'meta_description', 'meta_keywords'];
+ protected $fillable = ['locale', 'name', 'content', 'meta_title', 'meta_description', 'meta_keywords', 'unit'];
}
diff --git a/beike/Shop/Http/Resources/CartDetail.php b/beike/Shop/Http/Resources/CartDetail.php
index ceb00e35..bade6f77 100644
--- a/beike/Shop/Http/Resources/CartDetail.php
+++ b/beike/Shop/Http/Resources/CartDetail.php
@@ -26,7 +26,9 @@ class CartDetail extends JsonResource
};
$skuCode = $sku->sku;
$description = $product->description;
+
$productName = $description->name;
+ $unit = $description->unit ?? '';
$subTotal = $price * $this->quantity;
$image = $sku->image ?: $product->image;
@@ -37,6 +39,8 @@ class CartDetail extends JsonResource
'product_sku' => $skuCode,
'name' => $productName,
'name_format' => sub_string($productName),
+ 'unit' => $unit,
+ 'unit_format' => $unit,
'image' => $image,
'image_url' => image_resize($image),
'quantity' => $this->quantity,
diff --git a/beike/Shop/Http/Resources/ProductDetail.php b/beike/Shop/Http/Resources/ProductDetail.php
index 573279a9..183c8f5b 100644
--- a/beike/Shop/Http/Resources/ProductDetail.php
+++ b/beike/Shop/Http/Resources/ProductDetail.php
@@ -34,6 +34,7 @@ class ProductDetail extends JsonResource
return [
'id' => $this->id,
'name' => $this->description->name ?? '',
+ 'unit' => $this->description->unit ?? '',
'description' => $this->description->content ?? '',
'meta_title' => $this->description->meta_title ?? '',
'meta_keywords' => $this->description->meta_keywords ?? '',
diff --git a/beike/Shop/Http/Resources/ProductSimple.php b/beike/Shop/Http/Resources/ProductSimple.php
index 91fe4c18..b46f343d 100644
--- a/beike/Shop/Http/Resources/ProductSimple.php
+++ b/beike/Shop/Http/Resources/ProductSimple.php
@@ -31,6 +31,7 @@ class ProductSimple extends JsonResource
}
$name = $this->description->name ?? '';
+ $unit = $this->description->unit ?? '';
$images = $this->images != NULL ? $this->images : [];
$data = [
@@ -38,6 +39,8 @@ class ProductSimple extends JsonResource
'sku_id' => $masterSku->id,
'name' => $name,
'name_format' => $name,
+ 'unit' => $unit,
+ 'unit_format' => $unit,
'url' => $this->url,
'price' => $masterSku->price,
'origin_price' => $masterSku->origin_price,
diff --git a/resources/beike/admin/views/pages/products/form/form.blade.php b/resources/beike/admin/views/pages/products/form/form.blade.php
index f6f64b1d..2be41d44 100644
--- a/resources/beike/admin/views/pages/products/form/form.blade.php
+++ b/resources/beike/admin/views/pages/products/form/form.blade.php
@@ -136,7 +136,9 @@
- {{--