feat: 备货单车辆明细支持 attachment 附件字段
按前端对接文档,stock_order_items 每辆车支持附件 [{url,original_name}]:
- 模型 StockOrderItems:fillable 增加 attachment,新增 $casts=['attachment'=>'array']
(写自动 json_encode 落库、读自动 decode 回显)
- processVehicleItems:create 前归一化 attachment 为数组(store/update 共用此路径)
- generateVehicleUniqueId:排除 attachment,避免附件影响车辆去重/数量
show/detail 经模型 items 关系 + cast 自动回显 attachment;字段已由前端在库表就绪。
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -45,7 +45,14 @@ class StockOrderItems extends Model
|
||||
'id', 'order_id', 'product_code', 'sku_id', 'sku_snapshot',
|
||||
'model_snapshot', 'quantity', 'color_interior_code', 'color_interior_snapshot',
|
||||
'color_exterior_code', 'color_exterior_snapshot', 'remark', 'vin', 'created_at', 'updated_at',
|
||||
'mileage', 'unique_id'
|
||||
'mileage', 'unique_id', 'attachment'
|
||||
];
|
||||
|
||||
/**
|
||||
* 字段类型转换:attachment 以 JSON 数组存取(写自动 json_encode、读自动 decode)
|
||||
*/
|
||||
protected $casts = [
|
||||
'attachment' => 'array',
|
||||
];
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user