导入商品的详情
This commit is contained in:
parent
f4b8f07160
commit
5be0c7ce07
@ -12,7 +12,7 @@ class ProductCreate
|
|||||||
|
|
||||||
public function handle($event)
|
public function handle($event)
|
||||||
{
|
{
|
||||||
$merchant=Db::name('merchant')->where('mer_id',$event['product']['mer_id'])->find();
|
$merchant=Db::name('merchant')->where('status',1)->where('mer_state',1)->where('mer_id',$event['product']['mer_id'])->find();
|
||||||
if ($merchant['type_id']==11){
|
if ($merchant['type_id']==11){
|
||||||
$this->CloudMerchanSpu($merchant,$event);
|
$this->CloudMerchanSpu($merchant,$event);
|
||||||
}
|
}
|
||||||
@ -20,9 +20,8 @@ class ProductCreate
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$product_find=Db::name('store_product')->where('product_id',$event['product']['product_id'])->where('mer_id',$event['product']['mer_id'])->find();
|
$product_find=Db::name('store_product')->where('product_id',$event['product']['product_id'])->where('mer_id',$event['product']['mer_id'])->find();
|
||||||
|
|
||||||
//市级云仓
|
//市级云仓
|
||||||
$cityMerchantId = Db::name('merchant')->where('category_id',$merchant['category_id'])->where('type_id',13)->value('mer_id');
|
$cityMerchantId = Db::name('merchant')->where('status',1)->where('mer_state',1)->where('category_id',$merchant['category_id'])->where('type_id',13)->value('mer_id');
|
||||||
if ($cityMerchantId) {
|
if ($cityMerchantId) {
|
||||||
$is_product=0;
|
$is_product=0;
|
||||||
if ($product_find['bar_code']!='' &&in_array($product_find['product_type'],[0,98]) &&$product_find['spec_type']==0){
|
if ($product_find['bar_code']!='' &&in_array($product_find['product_type'],[0,98]) &&$product_find['spec_type']==0){
|
||||||
@ -42,8 +41,9 @@ class ProductCreate
|
|||||||
}
|
}
|
||||||
//镇街云仓
|
//镇街云仓
|
||||||
$is_product=0;
|
$is_product=0;
|
||||||
if ($merchant['type_id']==11){
|
if ($merchant['type_id']==10){
|
||||||
$townMerchantId = Db::name('merchant')->where('category_id',$merchant['category_id'])->where('type_id',11)->value('mer_id');
|
$townMerchantId = Db::name('merchant')->where('status',1)->where('mer_state',1)->where('category_id',$merchant['category_id'])->where('type_id',11)->value('mer_id');
|
||||||
|
if ($townMerchantId){
|
||||||
if ($product_find['bar_code']!='' &&in_array($product_find['product_type'],[0,98]) &&$product_find['spec_type']==0){
|
if ($product_find['bar_code']!='' &&in_array($product_find['product_type'],[0,98]) &&$product_find['spec_type']==0){
|
||||||
$find=Db::name('store_product')->where('bar_code',$product_find['bar_code'])->where('mer_id',$townMerchantId)->find();
|
$find=Db::name('store_product')->where('bar_code',$product_find['bar_code'])->where('mer_id',$townMerchantId)->find();
|
||||||
if (!$find){
|
if (!$find){
|
||||||
@ -59,7 +59,8 @@ class ProductCreate
|
|||||||
$this->AddProduct($townMerchantId,$product_find,$event);
|
$this->AddProduct($townMerchantId,$product_find,$event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function CloudMerchanSpu($data,$event){
|
public function CloudMerchanSpu($data,$event){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user