From 51acc25e87129b983c47feca07fb12eabcc42995 Mon Sep 17 00:00:00 2001 From: wuhui_zzw <1760308791@qq.com> Date: Fri, 28 Jun 2024 11:05:04 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=EF=BC=9A=E9=85=92=E9=81=93?= =?UTF-8?q?=E9=A6=86=E5=92=8C=E8=81=94=E7=9B=9F=E5=95=86=E5=AE=B6=E5=AE=A1?= =?UTF-8?q?=E6=A0=B8=E9=80=9A=E8=BF=87=E5=90=8E=E5=90=8C=E6=AD=A5=E5=AD=90?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/merchant/MerchantIntentionRepository.php | 1 + .../system/merchant/MerchantRepository.php | 2 +- app/controller/admin/system/merchant/Merchant.php | 1 + app/controller/api/Auth.php | 12 ++++++------ .../api/store/merchant/MerchantIntention.php | 2 +- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/app/common/repositories/system/merchant/MerchantIntentionRepository.php b/app/common/repositories/system/merchant/MerchantIntentionRepository.php index 2f8a46a..5b7b45f 100644 --- a/app/common/repositories/system/merchant/MerchantIntentionRepository.php +++ b/app/common/repositories/system/merchant/MerchantIntentionRepository.php @@ -139,6 +139,7 @@ class MerchantIntentionRepository extends BaseRepository 'agent_id' => $intention['merchant_type'] == 1 ? 0 : $intention['agent_id'] ?? 0,// 酒道馆是合伙人邀请加入 不能直接绑定 'merchant_type' => $intention['merchant_type'] ?? 0, 'invite_agent_id' => $intention['agent_id'] ?? 0, + 'merchant_sub_type' => $intention['merchant_sub_type'] ?? 0, ]; $data['fail_msg'] = ''; $smsData = [ diff --git a/app/common/repositories/system/merchant/MerchantRepository.php b/app/common/repositories/system/merchant/MerchantRepository.php index 664a9db..8d1b47c 100644 --- a/app/common/repositories/system/merchant/MerchantRepository.php +++ b/app/common/repositories/system/merchant/MerchantRepository.php @@ -101,7 +101,7 @@ class MerchantRepository extends BaseRepository $query->field('uid,nickname,avatar'); }, ]) - ->field('resource_shareholders_uid,merchant_type,sort,mer_id,mer_name,real_name,mer_phone,mer_address,mark,status,create_time,is_best,is_trader,type_id,category_id,copy_product_num,export_dump_num,is_margin,margin,ot_margin,mer_avatar,margin_remind_time,agent_id,shop_mer_id,brand_id') + ->field('merchant_sub_type,resource_shareholders_uid,merchant_type,sort,mer_id,mer_name,real_name,mer_phone,mer_address,mark,status,create_time,is_best,is_trader,type_id,category_id,copy_product_num,export_dump_num,is_margin,margin,ot_margin,mer_avatar,margin_remind_time,agent_id,shop_mer_id,brand_id') ->select(); return compact('count', 'list'); } diff --git a/app/controller/admin/system/merchant/Merchant.php b/app/controller/admin/system/merchant/Merchant.php index 712d897..b5c961a 100644 --- a/app/controller/admin/system/merchant/Merchant.php +++ b/app/controller/admin/system/merchant/Merchant.php @@ -232,6 +232,7 @@ class Merchant extends BaseController 'brand_id', ['resource_shareholders_uid',0], ['resource_shareholders_rate',0], + ['merchant_sub_type',0], ]); $data['mer_label'] = str_replace(',',',',$data['mer_label']); if (!$isUpdate) { diff --git a/app/controller/api/Auth.php b/app/controller/api/Auth.php index 928a7a0..08f32d5 100644 --- a/app/controller/api/Auth.php +++ b/app/controller/api/Auth.php @@ -786,18 +786,18 @@ class Auth extends BaseController * @return mixed */ public function searchUser(){ - $search = $this->request->params(['id_and_phone']); + $idAndPhone = $this->request->param('id_and_phone', 0); $userInfo = app()->make(UserRepository::class) ->getSearch([]) ->field(['uid','real_name','nickname','avatar','phone']) ->whereNull('cancel_time') - // 用户ID/联系电话 - ->when(!empty($search['id_and_phone']),function($query) use ($search){ - $query->where(function($query) use ($search){ - $query->where('uid',$search['id_and_phone'])->whereOr('phone',$search['id_and_phone']); + ->where(function($query) use ($idAndPhone){ + $query->where('uid',$idAndPhone)->whereOr(function($sql) use ($idAndPhone){ + $sql->where('phone',$idAndPhone)->whereNull('phone'); }); }) - ->findOrEmpty(); + ->findOrEmpty() + ->toArray(); return app('json')->success($userInfo); } diff --git a/app/controller/api/store/merchant/MerchantIntention.php b/app/controller/api/store/merchant/MerchantIntention.php index f0aa032..052d3b9 100644 --- a/app/controller/api/store/merchant/MerchantIntention.php +++ b/app/controller/api/store/merchant/MerchantIntention.php @@ -99,7 +99,7 @@ class MerchantIntention extends BaseController // 接收参数处理 protected function checkParams($id = 0){ // 参数获取 - $data = $this->request->params(['phone','mer_name','name','code','images','merchant_category_id','mer_type_id','manage_uid',['agent_id', 0],['merchant_type',0]]); + $data = $this->request->params(['phone','mer_name','name','code','images','merchant_category_id','mer_type_id','manage_uid',['agent_id', 0],['merchant_type',0],['merchant_sub_type',0]]); app()->make(MerchantIntentionValidate::class)->check($data); // $check = app()->make(SmsService::class)->checkSmsCode($data['phone'],$data['code'],'intention'); $data['mer_type_id'] = (int)$data['mer_type_id'];