Merge branch 'dev'

master
ELF 5 years ago
commit 1592e7602d

@ -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);

@ -93,7 +93,7 @@
<?php else:?> <?php else:?>
<a href="javascript:;" style="color: red;" class="cancel-shift-btn editbtn">取消换组</a> <a href="javascript:;" style="color: red;" class="cancel-shift-btn editbtn">取消换组</a>
<?php endif;?> <?php endif;?>
<?php endif;?>
<?php if(in_array($vo['id'], $hasPlayerList)):?> <?php if(in_array($vo['id'], $hasPlayerList)):?>
<?php if(!in_array($vo['id'], $hasShiftPlayerList)):?> <?php if(!in_array($vo['id'], $hasShiftPlayerList)):?>
<a href="javascript:;" class="shift-player-btn editbtn">玩家迁移</a> <a href="javascript:;" class="shift-player-btn editbtn">玩家迁移</a>
@ -101,6 +101,7 @@
<a href="javascript:;" style="color: red;" class="cancel-shift-player-btn editbtn">取消玩家迁移</a> <a href="javascript:;" style="color: red;" class="cancel-shift-player-btn editbtn">取消玩家迁移</a>
<?php endif;?> <?php endif;?>
<?php endif;?> <?php endif;?>
<?php endif;?>
</td> </td>
</tr> </tr>
</volist> </volist>

@ -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