Commit faf6ee50 authored by sugar's avatar sugar

Merge branch 'dev' of http://rungit.jxdsy.cn:10000/sugar/zhupu into dev

parents af88533e 06c47f76
...@@ -105,16 +105,19 @@ class Agent extends Backend ...@@ -105,16 +105,19 @@ class Agent extends Backend
if(empty($params['province_id'])){ if(empty($params['province_id'])){
$this->error("请选择省级"); $this->error("请选择省级");
} }
$data['group']=5;
unset($params['city_id']);unset($params['area_id']); unset($params['city_id']);unset($params['area_id']);
}else if($params["type"] == 4){ }else if($params["type"] == 4){
if(empty($params['city_id'])){ if(empty($params['city_id'])){
$this->error("请选择市级"); $this->error("请选择市级");
} }
$data['group']=6;
unset($params['area_id']); unset($params['area_id']);
}else if($params["type"] == 5){ }else if($params["type"] == 5){
if(empty($params['area_id'])){ if(empty($params['area_id'])){
$this->error("请选择区县级"); $this->error("请选择区县级");
} }
$data['group']=7;
} }
unset($params['family_id']); unset($params['family_id']);
} }
...@@ -122,7 +125,7 @@ class Agent extends Backend ...@@ -122,7 +125,7 @@ class Agent extends Backend
if(in_array($params['type'],[3,4,5])){ if(in_array($params['type'],[3,4,5])){
$data['username']=$params['mobile']; $data['username']=$params['mobile'];
$data['nickname']=$params['realname']; $data['nickname']=$params['realname'];
$data['agent_user_id']=$params['agent_user_id']; $data['agent_user_id']=$params['user_id'];
$data['action']="add"; $data['action']="add";
$admininfo = $this->Adminmodel->where(['username' =>$data['username']])->find(); $admininfo = $this->Adminmodel->where(['username' =>$data['username']])->find();
if(!$admininfo){ if(!$admininfo){
...@@ -196,23 +199,26 @@ class Agent extends Backend ...@@ -196,23 +199,26 @@ class Agent extends Backend
if(empty($params['province_id'])){ if(empty($params['province_id'])){
$this->error("请选择省级"); $this->error("请选择省级");
} }
$data['group']=5;
unset($params['city_id']);unset($params['area_id']); unset($params['city_id']);unset($params['area_id']);
}else if($params["type"] == 4){ }else if($params["type"] == 4){
if(empty($params['city_id'])){ if(empty($params['city_id'])){
$this->error("请选择市级"); $this->error("请选择市级");
} }
$data['group']=6;
unset($params['area_id']); unset($params['area_id']);
}else if($params["type"] == 5){ }else if($params["type"] == 5){
if(empty($params['area_id'])){ if(empty($params['area_id'])){
$this->error("请选择区县级"); $this->error("请选择区县级");
} }
$data['group']=7;
} }
unset($params['family_id']); unset($params['family_id']);
} }
if(in_array($params['type'],[3,4,5])){ if(in_array($params['type'],[3,4,5])){
$data['agent_user_id']=$params['agent_user_id']; $data['agent_user_id']=$params['user_id'];
$admin=Db::name("admin")->where(['agent_user_id'=>$params['agent_user_id']])->find(); $admin=Db::name("admin")->where(['agent_user_id'=>$params['user_id']])->find();
if($admin){ if($admin){
$data['action']="edit"; $data['action']="edit";
$admin =new Admin(); $admin =new Admin();
......
...@@ -14,7 +14,7 @@ class Admin extends Validate ...@@ -14,7 +14,7 @@ class Admin extends Validate
'username' => 'require|regex:\w{3,30}|unique:admin', 'username' => 'require|regex:\w{3,30}|unique:admin',
'nickname' => 'require', 'nickname' => 'require',
'password' => 'require|regex:\S{32}', 'password' => 'require|regex:\S{32}',
'email' => 'require|email|unique:admin,email', //'email' => 'require|email|unique:admin,email',
'mobile' => 'regex:1[3-9]\d{9}|unique:admin,mobile', 'mobile' => 'regex:1[3-9]\d{9}|unique:admin,mobile',
]; ];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment