From 825026be4249e8be116a2b89e9423902d72a38a1 Mon Sep 17 00:00:00 2001 From: wuhui_zzw <1760308791@qq.com> Date: Thu, 14 Mar 2024 14:03:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=EF=BC=9A=E7=83=9F=E9=85=92?= =?UTF-8?q?=E5=BA=97=E7=9B=B8=E5=85=B3=E5=85=BC=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/model/marketing/Agent.php | 3 ++- app/controller/api/Agent.php | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/common/model/marketing/Agent.php b/app/common/model/marketing/Agent.php index 425f35f..460c3ea 100644 --- a/app/common/model/marketing/Agent.php +++ b/app/common/model/marketing/Agent.php @@ -57,7 +57,7 @@ class Agent extends BaseModel{ * @return string */ public function getAgentTypeTextAttr():string{ - // 类型:1=总部发起人,2=省公司发起人,3=省合伙人(外勤),4=省合伙人(内勤),5=区县运营商,6=区县合伙人,7=餐厅,8=配送商,9=总部外勤,10=总部内勤 + // 类型:1=总部发起人,2=省公司发起人,3=省合伙人(外勤),4=省合伙人(内勤),5=区县运营商,6=区县合伙人,7=餐厅,8=配送商,9=总部外勤,10=总部内勤,10=烟酒店代销商 $agentType = $this->agent_type ?? -1; switch($agentType){ case 1: return '总部发起人';break; @@ -70,6 +70,7 @@ class Agent extends BaseModel{ case 8: return '配送商';break; case 9: return '总部外勤';break; case 10: return '总部内勤';break; + case 11: return '烟酒店代销商';break; } return ''; diff --git a/app/controller/api/Agent.php b/app/controller/api/Agent.php index 6f56435..01bba72 100644 --- a/app/controller/api/Agent.php +++ b/app/controller/api/Agent.php @@ -119,10 +119,10 @@ class Agent extends BaseController{ $data['uid'] = $this->request->uid(); // 信息验证 if((int)$data['pid'] <= 0) throw new ValidateException('非法请求,无邀请信息!'); - if(!in_array((int)$data['agent_type'], [2,3,4,5,6,7,8,9,10])) throw new ValidateException('非法请求,代理类型错误!'); + 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]) && (int)$data['province_id'] <= 0) 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'], [5,6,7])){ if((int)$data['city_id'] <= 0) throw new ValidateException('请选择地区!'); if((int)$data['area_id'] <= 0) throw new ValidateException('请选择地区!');