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('商户分类不存在');