diff --git a/app/listener/ProductCreate.php b/app/listener/ProductCreate.php index 572a3a09..ac540675 100644 --- a/app/listener/ProductCreate.php +++ b/app/listener/ProductCreate.php @@ -25,6 +25,15 @@ class ProductCreate return false; } + //查询市级供应链 + $mer = Db::name('merchant')->where('status', 1)->where('mer_state', 1)->where('category_id', $merchant['category_id'])->where('type_id',Merchant::TypeSupplyChain)->value('mer_id'); + if($mer==null){ + return false; + } + $product_id=Db::name('store_product')->where('mer_id',$mer)->where('bar_code', $product['bar_code'])->value('id'); + if($product_id==null){ + return false; + } // 根据支持同步到云商的商户进行同步操作 $syncMerArray = Db::name('MerchantType')->where('is_sync_prod', 1)->column('mer_type_id'); if (!in_array($merchant['type_id'], $syncMerArray)) {