From 27933547a9aa70cfbed46cde06136977db73a9e7 Mon Sep 17 00:00:00 2001 From: wuhui_zzw <1760308791@qq.com> Date: Fri, 12 Jul 2024 14:10:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=EF=BC=9A=E5=95=86=E6=88=B7?= =?UTF-8?q?=E5=85=A5=E9=A9=BB=E9=9A=90=E8=97=8F=E9=83=A8=E5=88=86=E5=BF=85?= =?UTF-8?q?=E5=A1=AB=E9=A1=B9=20=E5=87=8F=E5=B0=91=E5=85=A5=E9=A9=BB?= =?UTF-8?q?=E5=A1=AB=E5=86=99=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/store/merchant/MerchantIntention.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/controller/api/store/merchant/MerchantIntention.php b/app/controller/api/store/merchant/MerchantIntention.php index 9b729c8..8dc84ac 100644 --- a/app/controller/api/store/merchant/MerchantIntention.php +++ b/app/controller/api/store/merchant/MerchantIntention.php @@ -41,6 +41,7 @@ class MerchantIntention extends BaseController if($make->fieldExists('mer_phone',$data['phone'])) throw new ValidateException('手机号已存在,不可申请'); $adminRepository = app()->make(MerchantAdminRepository::class); if($adminRepository->fieldExists('account',$data['phone'])) throw new ValidateException('手机号已是管理员,不可申请'); + $intention = $this->repository->create($data); SwooleTaskService::admin('notice',[ 'type' => 'new_intention', @@ -100,25 +101,24 @@ 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],['merchant_sub_type',0]]); - app()->make(MerchantIntentionValidate::class)->check($data); + // 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']; // if(!$check) throw new ValidateException('验证码不正确'); - if(!in_array((int)$data['merchant_type'],[1,3,4,5,6,7])){ + /*if(!in_array((int)$data['merchant_type'],[1,3,4,5,6,7])){ // 判断:商户分类是否存在 $cateIsHas = app()->make(MerchantCategoryRepository::class)->get($data['merchant_category_id']); if(!$cateIsHas) throw new ValidateException('商户分类不存在'); // 判断:商户类型是否存在 $typeIsHas = app()->make(MerchantTypeRepository::class)->exists($data['mer_type_id']); if($data['mer_type_id'] && !$typeIsHas) throw new ValidateException('店铺类型不存在'); - } + }*/ // 判断:当前管理员身份是否有效 - $isService = app()->make(StoreServiceRepository::class)->isService($data['manage_uid'], $id, 1);// 是否存在店员信息 + $isService = app()->make(StoreServiceRepository::class)->isService($data['manage_uid'], $id, 1, $data['merchant_type']);// 是否存在店员信息 if($isService) throw new ValidateException('管理员身份无效,已成为其他商户管理员或店员!'); - $isManage = app()->make(repository::class)->isManage($data['manage_uid'], $id);// 是否存在审核中店长信息 + $isManage = app()->make(repository::class)->isManage($data['manage_uid'], $id, $data['merchant_type']);// 是否存在审核中店长信息 if($isManage) throw new ValidateException('管理员身份无效,已成为其他商户管理员!'); - unset($data['code']); return $data; }