From 7109aef2fc34752e841601219dfe66426b7655df Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Tue, 31 Oct 2023 18:30:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/api/store/product/StoreMicro.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/controller/api/store/product/StoreMicro.php b/app/controller/api/store/product/StoreMicro.php index 7d0eeeb6..a304d3ca 100644 --- a/app/controller/api/store/product/StoreMicro.php +++ b/app/controller/api/store/product/StoreMicro.php @@ -9,8 +9,9 @@ use crmeb\basic\BaseController; 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'); - $mer_type_id = Db::name('MerchantType')->where('type_code', 'in',[Merchant::TypeCode['TypeSupplyChain'],Merchant::TypeCode['TypeTownSupplyChain']])->column('mer_type_id'); + $mer_type_id = Db::name('MerchantType')->where('type_code', 'in',[Merchant::TypeCode['TypeSupplyChain'],Merchant::TypeCode['TypeTownSupplyChain'],Merchant::TypeCode['TypeStore']])->column('mer_type_id'); $platformMerId = app()->make(MerchantDao::class)->getValidMerchant(['category_id' => $category_id])->whereIn('type_id',$mer_type_id)->column('mer_id'); if($platformMerId==null){ return app('json')->fail('没有市级供应链或者镇级供应链'); @@ -24,6 +25,9 @@ class StoreMicro extends BaseController $product_id_arr=implode(',',$product_id_arr); $find=Db::name('store_product')->where('product_id',$product_id_arr)->where($productWhere)->select(); }else{ + if($name==''){ + return app('json')->fail('参数不能为空'); + } $find=Db::name('store_product')->whereIn('mer_id',$platformMerId)->where('store_name','like','%'.$name.'%')->where($productWhere)->select(); } if (count($find)==0){