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']])