diff --git a/Application/Admin/Controller/UserController.class.php b/Application/Admin/Controller/UserController.class.php index 79ced5041..b9b8ff816 100644 --- a/Application/Admin/Controller/UserController.class.php +++ b/Application/Admin/Controller/UserController.class.php @@ -250,7 +250,14 @@ class UserController extends AdminController { if($password != $repassword){ $this->error('管理员密码和确认密码不一致!'); } - + $usernameUser = M('UcenterMember', 'sys_')->field('username')->where(['username' => $username])->find(); + if (!empty($usernameUser)) { + $this->error('用户名已存在!'); + } + $emailUser = M('UcenterMember', 'sys_')->field('username')->where(['username' => $username])->find(); + if (!empty($emailUser)) { + $this->error('邮箱已存在!'); + } /* 调用注册接口注册用户 */ $User = new UserApi; $uid = $User->register($username, $password, $email,$second_pwd); diff --git a/Application/Home/View/default/Promote/mygrand.html b/Application/Home/View/default/Promote/mygrand.html index 9d4b99d78..98c0f7d55 100644 --- a/Application/Home/View/default/Promote/mygrand.html +++ b/Application/Home/View/default/Promote/mygrand.html @@ -93,12 +93,13 @@ 取消换组 - - - - 玩家迁移 - - 取消玩家迁移 + + + + 玩家迁移 + + 取消玩家迁移 + diff --git a/Application/User/Model/UcenterMemberModel.class.php b/Application/User/Model/UcenterMemberModel.class.php index 6f927f44b..0ff123746 100644 --- a/Application/User/Model/UcenterMemberModel.class.php +++ b/Application/User/Model/UcenterMemberModel.class.php @@ -102,7 +102,7 @@ class UcenterMemberModel extends Model{ * @param string $mobile 用户手机号码 * @return integer 注册成功-用户信息,注册失败-错误编号 */ - public function register($username, $password, $email,$second_pwd,$mobile){ + public function register($username, $password, $email, $second_pwd,$mobile){ $data = array( 'username' => $username, 'password' => $password, @@ -110,11 +110,13 @@ class UcenterMemberModel extends Model{ 'email' => $email, 'mobile' => $mobile, ); - + //验证手机 if(empty($data['mobile'])) unset($data['mobile']); /* 添加用户 */ if($data = $this->create($data)){ + $data['username'] = $username; + $data['email'] = $email; $status = M('UcenterMember', 'sys_')->data($data)->add(); $uid = 0; if ($status) {