价格增加百分比上浮

This commit is contained in:
liu
2026-08-06 14:52:56 +08:00
parent 07b08c8915
commit c6f69c5c55
19 changed files with 958 additions and 93 deletions
+8
View File
@@ -37,6 +37,7 @@ class ProductModel extends Model
'shelf_life',
'stock',
'status',
'cost_price',
'remark',
];
@@ -47,12 +48,19 @@ class ProductModel extends Model
'stock' => 'integer',
'sort' => 'integer',
'status' => 'integer',
'cost_price' => 'decimal:2',
'created_at' => 'datetime:Y-m-d H:i:s',
'updated_at' => 'datetime:Y-m-d H:i:s',
];
protected $appends = ['images_arr'];
/**
* 成本价属商业敏感数据,默认不随 toArray 输出(防止泄漏到小程序/供应商端);
* 后台管理接口需在查询结果上调用 makeVisible('cost_price') 恢复。
*/
protected $hidden = ['cost_price'];
/**
* 封面图片
*/