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('请选择地区!');