|
@@ -179,6 +179,7 @@ class User extends Base_Controller{
|
|
|
|
|
|
$email = $this->input->post('email',true);
|
|
|
$data['company'] = $this->input->post('company',true);
|
|
|
+ $data['role'] = intval($this->input->post('role'));
|
|
|
$avatar = $this->input->post('avatar',true);
|
|
|
if (isset($avatar) && !empty($avatar)) {
|
|
|
$path = parse_url($avatar);
|
|
@@ -248,7 +249,7 @@ class User extends Base_Controller{
|
|
|
$data['privilege'] = $privilegeIds;
|
|
|
|
|
|
// 验证登录账号是否存在
|
|
|
- if ($this->User_model->getDataCount(array('username'=>$data['username']))) {
|
|
|
+ if ($this->User_model->getDataCount(array('username'=>$data['username'],'role'=>$data['role']))) {
|
|
|
exit(json_result('0706',$this->response['0706'],array()));
|
|
|
}
|
|
|
if (!empty($data['phone']) && $this->User_model->getDataCount(array('phone'=>$data['phone']))) {
|
|
@@ -259,7 +260,6 @@ class User extends Base_Controller{
|
|
|
}
|
|
|
|
|
|
$data['pid'] = $this->get_user_info('id');
|
|
|
- $data['role'] = intval($this->input->post('role'));
|
|
|
|
|
|
if (empty($data['role'])) exit(json_result('0724',$this->response['0724']));
|
|
|
|
|
@@ -297,7 +297,7 @@ class User extends Base_Controller{
|
|
|
|
|
|
$privilegeIds = $this->input->post('privilegeIds',true);
|
|
|
if ($privilegeIds !== NULL && $privilegeIds !== '') $data['privilege'] = $privilegeIds;
|
|
|
- $data['role'] = intval($this->input->post('role'));
|
|
|
+
|
|
|
|
|
|
if (empty($data['role'])) exit(json_result('0724',$this->response['0724']));
|
|
|
|