master
ELF 5 years ago
parent b41705941f
commit 29e4b4e501

@ -250,7 +250,14 @@ class UserController extends AdminController {
if($password != $repassword){ if($password != $repassword){
$this->error('管理员密码和确认密码不一致!'); $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; $User = new UserApi;
$uid = $User->register($username, $password, $email,$second_pwd); $uid = $User->register($username, $password, $email,$second_pwd);

@ -115,6 +115,8 @@ class UcenterMemberModel extends Model{
if(empty($data['mobile'])) unset($data['mobile']); if(empty($data['mobile'])) unset($data['mobile']);
/* 添加用户 */ /* 添加用户 */
if($data = $this->create($data)){ if($data = $this->create($data)){
$data['username'] = $username;
$data['email'] = $email;
$status = M('UcenterMember', 'sys_')->data($data)->add(); $status = M('UcenterMember', 'sys_')->data($data)->add();
$uid = 0; $uid = 0;
if ($status) { if ($status) {

Loading…
Cancel
Save