[FEAT] 商品管理模組重構、UI 清晰度優化與多語系標籤字體調整
This commit is contained in:
@@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user