From 8e8a031b051d2aedba03744379d343abbdc9bdaf Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Sat, 10 Aug 2024 11:22:34 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BF=AE=E6=94=B9=E4=BB=93=E5=BA=93?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E9=80=BB=E8=BE=91=EF=BC=8C=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E5=BA=93=E5=AD=98=E7=AE=A1=E7=90=86=EF=BC=8C=E6=8F=90=E9=AB=98?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=AE=89=E5=85=A8=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/logic/store_product/StoreProductLogic.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/admin/logic/store_product/StoreProductLogic.php b/app/admin/logic/store_product/StoreProductLogic.php index ea5b3477b..cada0b7d8 100644 --- a/app/admin/logic/store_product/StoreProductLogic.php +++ b/app/admin/logic/store_product/StoreProductLogic.php @@ -89,11 +89,17 @@ class StoreProductLogic extends BaseLogic } else { if (is_array($params['store_arr']) && count($params['store_arr']) > 0) { foreach ($params['store_arr'] as $key => $store_id) { - Redis::send('store-storage', ['product_arr' => ['id' => $res['id'], 'stock' => 0], 'store_id' => $store_id,'stock_type'=>1, 'admin_id' => Request()->adminId]); + if($store_id!=5){ + 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']]); } } + if(getenv('STORE_ID')){ + Redis::send('store-storage', ['product_arr' => ['id' => $res['id'], 'stock' => 0], 'store_id' => getenv('STORE_ID'),'stock_type'=>1, 'admin_id' => Request()->adminId]); + } + return true; } catch (\Exception $e) { Db::rollback();