feat: 修改库存逻辑增加库存类型

This commit is contained in:
mkm 2024-06-24 15:16:21 +08:00
parent 0d41b39a39
commit 9df52eb5ac

View File

@ -78,13 +78,13 @@ class StoreProductLogic extends BaseLogic
if ($params['is_store_all'] == 1) { if ($params['is_store_all'] == 1) {
$store_arr = SystemStore::where('is_show', 1)->column('id'); $store_arr = SystemStore::where('is_show', 1)->column('id');
foreach ($store_arr as $store_id) { foreach ($store_arr as $store_id) {
Redis::send('store-storage', ['product_arr' => ['id' => $res['id'], 'stock' => 0], 'store_id' => $store_id, 'admin_id' => Request()->adminId]); Redis::send('store-storage', ['product_arr' => ['id' => $res['id'], 'stock' => 0], 'store_id' => $store_id,'stock_type'=>1, 'admin_id' => Request()->adminId]);
} }
// Redis::send('copy-product', ['product_id' => $res['id'], 'store_arr' => $store_arr]); // Redis::send('copy-product', ['product_id' => $res['id'], 'store_arr' => $store_arr]);
} else { } else {
if (is_array($params['store_arr']) && count($params['store_arr']) > 0) { if (is_array($params['store_arr']) && count($params['store_arr']) > 0) {
foreach ($params['store_arr'] as $key => $store_id) { foreach ($params['store_arr'] as $key => $store_id) {
Redis::send('store-storage', ['product_arr' => ['id' => $res['id'], 'stock' => 0], 'store_id' => $store_id, 'admin_id' => Request()->adminId]); Redis::send('store-storage', ['product_arr' => ['id' => $res['id'], 'stock' => 0], 'store_id' => $store_id,'stock_type'=>1, 'admin_id' => Request()->adminId]);
} }
// Redis::send('copy-product', ['product_id' => $res['id'], 'store_arr' => $params['store_arr']]); // Redis::send('copy-product', ['product_id' => $res['id'], 'store_arr' => $params['store_arr']]);
} }