From d77dcd89ebb15e42f744d5e5a4c2d1f1505390b0 Mon Sep 17 00:00:00 2001 From: wuhui_zzw <1760308791@qq.com> Date: Thu, 25 Apr 2024 18:10:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=EF=BC=9A=E5=9F=8E=E5=B8=82?= =?UTF-8?q?=E4=BC=9A=E5=AE=A2=E5=8E=85=E9=82=80=E8=AF=B7=E7=A0=81=E7=94=9F?= =?UTF-8?q?=E6=88=90=20=E6=B7=BB=E5=8A=A0=EF=BC=9A=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E6=98=AF=E5=90=A6=E5=AD=98=E5=9C=A8=E5=9F=8E=E5=B8=82=E4=BC=9A?= =?UTF-8?q?=E5=AE=A2=E5=8E=85=E6=9C=89=E6=95=88=E5=91=98=E5=B7=A5=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/model/user/User.php | 20 +++++++++++++++++++ .../marketing/AgentRepository.php | 6 ++++++ .../store/service/StoreServiceRepository.php | 2 +- app/controller/api/Auth.php | 1 + .../api/store/merchant/MerchantIntention.php | 2 +- 5 files changed, 29 insertions(+), 2 deletions(-) diff --git a/app/common/model/user/User.php b/app/common/model/user/User.php index e16d6a2..7af352e 100644 --- a/app/common/model/user/User.php +++ b/app/common/model/user/User.php @@ -303,6 +303,26 @@ class User extends BaseModel return !empty($info) ? $info->toArray() : null; } + // 用户是否存在城市会客厅 有效店员信息 + public function getHallServiceAttr(){ + $info = (new StoreService()) + ->field('service_id,uid,nickname,avatar,customer,StoreService.mer_id,is_verify,is_goods,is_open') + ->hasWhere('merchant',function($query){ + $query->where('is_del', 0) + ->where('mer_state', 1) + ->where('merchant_type', 6) + ->where('status', 1); + }) + ->where('uid',$this->uid) + ->where('StoreService.mer_id','<>',0) + ->where('StoreService.is_del',0) + ->where('is_open',1) + ->order('StoreService.is_verify DESC,StoreService.customer DESC') + // ->fetchSql() + ->find(); + + return !empty($info) ? $info->toArray() : null; + } diff --git a/app/common/repositories/marketing/AgentRepository.php b/app/common/repositories/marketing/AgentRepository.php index dc149f2..939a4d1 100644 --- a/app/common/repositories/marketing/AgentRepository.php +++ b/app/common/repositories/marketing/AgentRepository.php @@ -116,6 +116,12 @@ class AgentRepository extends BaseRepository{ $path = 'pages/store/settled/index'; return app()->make(QrcodeService::class)->createQrCode($valueData,$path); break; + case 'hall': + // 参数长度超过 简写:aid=agent_id;mt=merchant_type + $valueData = 'aid=' . $params['agent_id'].'&mt=6'; + $path = 'pages/store/settled/index'; + return app()->make(QrcodeService::class)->createQrCode($valueData,$path); + break; } throw new ValidateException('小程序码生成失败!'); diff --git a/app/common/repositories/store/service/StoreServiceRepository.php b/app/common/repositories/store/service/StoreServiceRepository.php index a242a92..20629a1 100644 --- a/app/common/repositories/store/service/StoreServiceRepository.php +++ b/app/common/repositories/store/service/StoreServiceRepository.php @@ -107,7 +107,7 @@ class StoreServiceRepository extends BaseRepository ] ]; } - else if(in_array($merchantType,[1,3,4])){ + else if(in_array($merchantType,[1,3,4,6])){ $adminRule = [ Elm::switches('is_verify', '核销权限', 1)->activeValue(1)->inactiveValue(0)->inactiveText('关')->activeText('开')->col(8), // Elm::switches('product_exchange', '商品兑换码', 1)->activeValue(1)->inactiveValue(0)->inactiveText('关')->activeText('开')->col(8), diff --git a/app/controller/api/Auth.php b/app/controller/api/Auth.php index 31bf4f4..ad6b509 100644 --- a/app/controller/api/Auth.php +++ b/app/controller/api/Auth.php @@ -171,6 +171,7 @@ class Auth extends BaseController 'supermarketService', 'smokeMerService', 'provinceService', + 'hallService', 'total_collect_product', 'total_collect_store', 'total_coupon', diff --git a/app/controller/api/store/merchant/MerchantIntention.php b/app/controller/api/store/merchant/MerchantIntention.php index 1e00150..cb45cdc 100644 --- a/app/controller/api/store/merchant/MerchantIntention.php +++ b/app/controller/api/store/merchant/MerchantIntention.php @@ -104,7 +104,7 @@ class MerchantIntention extends BaseController // $check = app()->make(SmsService::class)->checkSmsCode($data['phone'],$data['code'],'intention'); $data['mer_type_id'] = (int)$data['mer_type_id']; // if(!$check) throw new ValidateException('验证码不正确'); - if(!in_array((int)$data['merchant_type'],[1,3])){ + if(!in_array((int)$data['merchant_type'],[1,3,4,5,6])){ // 判断:商户分类是否存在 $cateIsHas = app()->make(MerchantCategoryRepository::class)->get($data['merchant_category_id']); if(!$cateIsHas) throw new ValidateException('商户分类不存在');