refactor(warehouse): 优化仓库产品逻辑中的数值处理
- 将 price、purchase 和 total_price 字段的默认值改为 0 - 确保这些字段在没有提供值时不会为空字符串 - 提高了代码的健壮性和一致性
This commit is contained in:
parent
61a5d5d6d5
commit
36c1c45415
@ -154,8 +154,9 @@ class WarehouseProductLogic extends BaseLogic
|
||||
'nums' => $params['nums'],
|
||||
'before_nums' => $storege['nums'],
|
||||
'after_nums' => $after_nums,
|
||||
'purchase' => $params['purchase'] ?? '',
|
||||
'total_price' => $params['total_price'] ?? '',
|
||||
'price' => $params['price'] ?? 0,
|
||||
'purchase' => $params['purchase'] ?? 0,
|
||||
'total_price' => $params['total_price'] ?? 0,
|
||||
'admin_id' => $params['admin_id'],
|
||||
'code' => $params['code'] ?? '',
|
||||
'status' => 1,
|
||||
|
Loading…
x
Reference in New Issue
Block a user