feat: 修改库存管理逻辑,增强库存检查与错误处理,优化代码结构

This commit is contained in:
mkm 2024-08-10 21:16:25 +08:00
parent 4b2a0642f6
commit 9122fa3199

View File

@ -447,7 +447,7 @@ class StoreProductLogic extends BaseLogic
]; ];
StoreBranchProductAttrValue::create($arr); StoreBranchProductAttrValue::create($arr);
if ($product_arr['stock'] > 0) { if ($product_arr['stock'] > 0) {
self::storage($find, $store_id, $admin_id, $product_arr,$warehouse_id); self::storage($find, $store_id, $admin_id, $product_arr,1,$warehouse_id);
} }
Db::commit(); Db::commit();
return true; return true;