This commit is contained in:
mkm 2023-10-31 14:28:43 +08:00
parent d322adf571
commit 5466d03584

View File

@ -10,8 +10,8 @@ class StoreMicro extends BaseController
{
function seach_bar_code($mer_id,$code='',$name=''){
$category_id=Db::name('merchant')->where('mer_id',$mer_id)->value('category_id');
$typePlatformId = Db::name('MerchantType')->where('type_code', 'in',[Merchant::TypePlatform,Merchant::TypeTownSupplyChain])->column('mer_type_id');
$platformMerId = app()->make(MerchantDao::class)->getValidMerchant(['category_id' => $category_id])->whereIn('type_id',$typePlatformId)->value('mer_id');
$typePlatformId = Db::name('MerchantType')->where('type_code', 'in',[Merchant::TypeCode['TypePlatform'],Merchant::TypeCode['TypeTownSupplyChain']])->column('mer_type_id');
$platformMerId = app()->make(MerchantDao::class)->getValidMerchant(['category_id' => $category_id])->whereIn('type_id',$typePlatformId)->column('mer_id');
if($platformMerId==null){
return app('json')->fail('没有市级供应链或者镇级供应链');
}
@ -20,7 +20,7 @@ class StoreMicro extends BaseController
if (strlen($code) != 13) {
return app('json')->success('条形码长度不正确');
}
$product_id_arr=Db::name('store_product_attr_value')->where('mer_id',$platformMerId)->where('bar_code',$code)->column('product_id');
$product_id_arr=Db::name('store_product_attr_value')->whereIn('mer_id',$platformMerId)->where('bar_code',$code)->column('product_id');
$product_id_arr=implode(',',$product_id_arr);
$find=Db::name('store_product')->where('product_id',$product_id_arr)->where($productWhere)->select();
}else{