From 85e1e55bc0bffda562d025f0cb865f17dcaa653f Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Tue, 31 Oct 2023 11:59:13 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/dao/store/order/StoreCartDao.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/common/dao/store/order/StoreCartDao.php b/app/common/dao/store/order/StoreCartDao.php index 6410b6d0..78dc5828 100644 --- a/app/common/dao/store/order/StoreCartDao.php +++ b/app/common/dao/store/order/StoreCartDao.php @@ -116,7 +116,7 @@ class StoreCartDao extends BaseDao ->append(['bc_extension_one', 'bc_extension_two']); }, 'merchant' => function (Relation $query) use ($uid) { - $query->field('mer_id,mer_name,mer_state,mer_avatar,delivery_way,commission_rate,category_id') + $query->field('mer_id,mer_name,mer_state,mer_avatar,delivery_way,commission_rate,category_id,credit_buy,settle_cycle,interest_rate') ->with([ 'coupon' => function ($query) use ($uid) { $query->where('uid', $uid); From d322adf5718cf1d3d795330ae12eb24a8570d4ac Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Tue, 31 Oct 2023 14:14:00 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/api/store/product/StoreMicro.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/controller/api/store/product/StoreMicro.php b/app/controller/api/store/product/StoreMicro.php index 1965420a..5bac9ff1 100644 --- a/app/controller/api/store/product/StoreMicro.php +++ b/app/controller/api/store/product/StoreMicro.php @@ -10,8 +10,11 @@ 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', Merchant::TypeCode['TypePlatform'])->value('mer_type_id'); - $platformMerId = app()->make(MerchantDao::class)->getValidMerchant(['category_id' => $category_id, 'type_id' => $typePlatformId], 'mer_id')->value('mer_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'); + if($platformMerId==null){ + return app('json')->fail('没有市级供应链或者镇级供应链'); + } $productWhere = ['is_show' => 1, 'status' => 1, 'mer_status' => 1, 'is_del' => 0]; if($code!=''){ if (strlen($code) != 13) { @@ -21,7 +24,7 @@ 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{ - $find=Db::name('store_product')->where('mer_id',$platformMerId)->where('store_name','like','%'.$name.'%')->where($productWhere)->select(); + $find=Db::name('store_product')->whereIn('mer_id',$platformMerId)->where('store_name','like','%'.$name.'%')->where($productWhere)->select(); } if (count($find)==0){ if($code!=''){ From 5466d0358439c8624b1a27fb0c34c4258b74e4f1 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Tue, 31 Oct 2023 14:28:43 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=9B=B4=E6=96=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, 3 insertions(+), 3 deletions(-) diff --git a/app/controller/api/store/product/StoreMicro.php b/app/controller/api/store/product/StoreMicro.php index 5bac9ff1..3ac98201 100644 --- a/app/controller/api/store/product/StoreMicro.php +++ b/app/controller/api/store/product/StoreMicro.php @@ -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{