添加:烟酒店相关兼容
This commit is contained in:
parent
7b45836832
commit
825026be42
|
|
@ -57,7 +57,7 @@ class Agent extends BaseModel{
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function getAgentTypeTextAttr():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;
|
$agentType = $this->agent_type ?? -1;
|
||||||
switch($agentType){
|
switch($agentType){
|
||||||
case 1: return '总部发起人';break;
|
case 1: return '总部发起人';break;
|
||||||
|
|
@ -70,6 +70,7 @@ class Agent extends BaseModel{
|
||||||
case 8: return '配送商';break;
|
case 8: return '配送商';break;
|
||||||
case 9: return '总部外勤';break;
|
case 9: return '总部外勤';break;
|
||||||
case 10: return '总部内勤';break;
|
case 10: return '总部内勤';break;
|
||||||
|
case 11: return '烟酒店代销商';break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return '';
|
return '';
|
||||||
|
|
|
||||||
|
|
@ -119,10 +119,10 @@ class Agent extends BaseController{
|
||||||
$data['uid'] = $this->request->uid();
|
$data['uid'] = $this->request->uid();
|
||||||
// 信息验证
|
// 信息验证
|
||||||
if((int)$data['pid'] <= 0) throw new ValidateException('非法请求,无邀请信息!');
|
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_name'])) throw new ValidateException('请输入联系人姓名!');
|
||||||
if(empty($data['contact_phone'])) 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(in_array((int)$data['agent_type'], [5,6,7])){
|
||||||
if((int)$data['city_id'] <= 0) throw new ValidateException('请选择地区!');
|
if((int)$data['city_id'] <= 0) throw new ValidateException('请选择地区!');
|
||||||
if((int)$data['area_id'] <= 0) throw new ValidateException('请选择地区!');
|
if((int)$data['area_id'] <= 0) throw new ValidateException('请选择地区!');
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue