[FEAT] 商品管理模組重構、UI 清晰度優化與多語系標籤字體調整

This commit is contained in:
2026-03-26 17:32:15 +08:00
parent ac51027dda
commit 8ec5473ec7
12 changed files with 1152 additions and 9 deletions

View File

@@ -15,21 +15,31 @@ class Product extends Model
'company_id',
'category_id',
'name',
'name_dictionary_key',
'sku',
'barcode',
'spec',
'manufacturer',
'description',
'price',
'member_price',
'cost',
'track_limit',
'spring_limit',
'type',
'image_url',
'status',
'name_dictionary_key',
'is_active',
'metadata',
];
protected $casts = [
'price' => 'decimal:2',
'member_price' => 'decimal:2',
'cost' => 'decimal:2',
'track_limit' => 'integer',
'spring_limit' => 'integer',
'is_active' => 'boolean',
'metadata' => 'array',
];
@@ -37,4 +47,13 @@ class Product extends Model
{
return $this->belongsTo(ProductCategory::class, 'category_id');
}
/**
* Get the translations for the product name.
*/
public function translations()
{
return $this->hasMany(\App\Models\System\Translation::class, 'key', 'name_dictionary_key')
->where('group', 'product');
}
}