From c8a49e73f679a75a9ca14568befd8d49c3d99d7e Mon Sep 17 00:00:00 2001 From: wuhui_zzw <1760308791@qq.com> Date: Tue, 26 Mar 2024 16:05:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E4=BB=A3=E7=90=86?= =?UTF-8?q?=E5=9C=A8=E7=A7=BB=E5=8A=A8=E7=AB=AF=E7=94=B3=E8=AF=B7=E6=97=B6?= =?UTF-8?q?=20=E5=88=A4=E6=96=AD=E9=94=99=E8=AF=AF=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E4=B8=8D=E8=83=BD=E9=87=8D=E5=A4=8D=E7=94=B3=E8=AF=B7=E5=85=B6?= =?UTF-8?q?=E4=BB=96=E8=A7=92=E8=89=B2=EF=BC=8C=E5=AF=BC=E8=87=B4=E9=85=8D?= =?UTF-8?q?=E9=80=81=E5=95=86=E4=B8=8D=E8=83=BD=E6=AD=A3=E5=B8=B8=E7=94=B3?= =?UTF-8?q?=E8=AF=B7=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/api/Agent.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/app/controller/api/Agent.php b/app/controller/api/Agent.php index ba3b781..63d9288 100644 --- a/app/controller/api/Agent.php +++ b/app/controller/api/Agent.php @@ -122,7 +122,7 @@ class Agent extends BaseController{ if(!in_array((int)$data['agent_type'], [2,3,4,5,6,7,8,9,10,11])) throw new ValidateException('非法请求,代理类型错误!'); if(empty($data['contact_name'])) throw new ValidateException('请输入联系人姓名!'); if(empty($data['contact_phone'])) throw new ValidateException('请输入联系人电话!'); - if(!in_array((int)$data['agent_type'], [2,3,4,9,10,11]) && (int)$data['province_id'] <= 0) throw new ValidateException('请选择地区!'); + if(!in_array((int)$data['agent_type'], [2,3,4,8,9,10,11]) && (int)$data['province_id'] <= 0) throw new ValidateException('请选择地区!'); if(in_array((int)$data['agent_type'], [5,6,7])){ if((int)$data['city_id'] <= 0) throw new ValidateException('请选择地区!'); if((int)$data['area_id'] <= 0) throw new ValidateException('请选择地区!'); @@ -216,16 +216,16 @@ class Agent extends BaseController{ break; } // 信息是否重复 - $isHas = (int)app()->make(AgentApplyRepository::class) - ->getSearchModel(['contact_phone'=>$data['contact_phone']]) - ->when($agentApplyId > 0,function($query) use ($agentApplyId){ - $query->where('id','<>',$agentApplyId); - })->count(); - if($isHas > 0) throw new ValidateException('联系人电话已经存在,请勿重复申请!'); - $isHas = (int)$this->repository - ->getSearchModel(['contact_phone'=>$data['contact_phone']]) - ->count(); - if($isHas > 0) throw new ValidateException('联系人电话已经存在,请勿重复申请!'); + // $isHas = (int)app()->make(AgentApplyRepository::class) + // ->getSearchModel(['contact_phone'=>$data['contact_phone']]) + // ->when($agentApplyId > 0,function($query) use ($agentApplyId){ + // $query->where('id','<>',$agentApplyId); + // })->count(); + // if($isHas > 0) throw new ValidateException('联系人电话已经存在,请勿重复申请!'); + // $isHas = (int)$this->repository + // ->getSearchModel(['contact_phone'=>$data['contact_phone']]) + // ->count(); + // if($isHas > 0) throw new ValidateException('联系人电话已经存在,请勿重复申请!'); // 不能 重复成为当前等级的用户 $isHas = (int)$this->repository ->getSearchModel(['agent_type'=>$data['agent_type'],'uid'=>$data['uid']])