|
|
|
@ -1084,7 +1084,9 @@ class UserController extends BaseController
|
|
|
|
|
$userApi = new MemberApi();
|
|
|
|
|
$log['uid'] = $user['user_id'];
|
|
|
|
|
$log['game_id'] = $user['game_id'];
|
|
|
|
|
$log['action'] = json_encode($user);
|
|
|
|
|
$log['action'] = json_encode($user);;
|
|
|
|
|
$action = [];
|
|
|
|
|
// $log['action'] = json_encode($user);
|
|
|
|
|
switch ($user['code']) {
|
|
|
|
|
|
|
|
|
|
case 'phone':
|
|
|
|
@ -1104,11 +1106,16 @@ class UserController extends BaseController
|
|
|
|
|
log_action($log);
|
|
|
|
|
$this -> new_set_message(1098, '该手机号已被绑定');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$action['phone'] = $user['phone'];
|
|
|
|
|
|
|
|
|
|
$log['action'] = json_encode($action);
|
|
|
|
|
#验证短信验证码
|
|
|
|
|
$this -> sms_verify2($user['phone'], $user['sms_code']);
|
|
|
|
|
$data['phone'] = $user['phone'];
|
|
|
|
|
break;
|
|
|
|
|
case 'nickname':
|
|
|
|
|
$log['type'] = 7;
|
|
|
|
|
$nickname_len = $user['nickname'];
|
|
|
|
|
$encode = mb_detect_encoding($user['nickname'], array('UTF-8','GB2312','GBK'));
|
|
|
|
|
if($encode == "UTF-8"){
|
|
|
|
@ -1122,6 +1129,14 @@ class UserController extends BaseController
|
|
|
|
|
if (!empty($nk) && is_array($nk) && $user['user_id'] != $nk['id']) {
|
|
|
|
|
$this -> new_set_message(1012, "昵称已被使用");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$old_data = M('User', 'tab_') -> field('id,account,nickname') -> where(['id' => $user['user_id']]) -> find();
|
|
|
|
|
|
|
|
|
|
$action['old_data'] = $old_data['nickname'];
|
|
|
|
|
$action['new_data'] = $user['nickname'];
|
|
|
|
|
|
|
|
|
|
$log['action'] = json_encode($action);
|
|
|
|
|
|
|
|
|
|
$data['nickname'] = $user['nickname'];
|
|
|
|
|
break;
|
|
|
|
|
case 'pwd':
|
|
|
|
@ -1977,13 +1992,26 @@ class UserController extends BaseController
|
|
|
|
|
$this -> sms_verify($data['phone'], $data['code']);
|
|
|
|
|
$map['id'] = $data['user_id'];
|
|
|
|
|
$user = M('user', 'tab_') -> where($map) -> setField('phone', "");
|
|
|
|
|
|
|
|
|
|
$log['uid'] = $data['user_id'];
|
|
|
|
|
$log['account'] = $user['account'];
|
|
|
|
|
$log['game_id'] = $data['game_id'];
|
|
|
|
|
$log['type'] = 8;
|
|
|
|
|
$action['phone'] = $data['phone'];
|
|
|
|
|
$log['action'] = json_encode($action);
|
|
|
|
|
|
|
|
|
|
if ($user) {
|
|
|
|
|
|
|
|
|
|
echo base64_encode(json_encode(array('status' => 200, 'return_msg' => '解绑成功')));
|
|
|
|
|
$log['remarks'] = "解绑成功";
|
|
|
|
|
log_action($log);
|
|
|
|
|
|
|
|
|
|
echo base64_encode(json_encode(array('status' => 200, 'return_msg' => '解绑成功')));
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
$log['remarks'] = "解绑失败";
|
|
|
|
|
log_action($log);
|
|
|
|
|
|
|
|
|
|
echo base64_encode(json_encode(array('status' => - 1, 'return_msg' => '解绑失败')));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -2371,7 +2399,11 @@ class UserController extends BaseController
|
|
|
|
|
$log['uid'] = $user['user_id'];
|
|
|
|
|
$log['game_id'] = $user['game_id'];
|
|
|
|
|
$log['type'] = 2;
|
|
|
|
|
$log['action'] = json_encode($user);
|
|
|
|
|
// $log['action'] = json_encode($user);
|
|
|
|
|
$log['action'] = '';
|
|
|
|
|
|
|
|
|
|
$action = [];
|
|
|
|
|
|
|
|
|
|
if (empty($user['user_id']) || empty($user['idcard']) || empty($user['real_name'])) {
|
|
|
|
|
$this -> set_message(1066, "fail", "用户数据异常");
|
|
|
|
|
|
|
|
|
@ -2467,12 +2499,20 @@ class UserController extends BaseController
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$old_data = M('User', 'tab_') -> where($map) ->field('idcard,real_name')-> find();
|
|
|
|
|
|
|
|
|
|
$action['old_data'] = $old_data;
|
|
|
|
|
$action['new_data'] = ['idcard'=>$data['idcard'],'real_name'=>$data['real_name']];
|
|
|
|
|
|
|
|
|
|
$log['action'] = json_encode($action);
|
|
|
|
|
|
|
|
|
|
$return = M('User', 'tab_') -> where($map) -> save($data);
|
|
|
|
|
if ($return === false) {
|
|
|
|
|
$log['remarks'] = '用户数据更新失败';
|
|
|
|
|
log_action($log);
|
|
|
|
|
$this -> set_message(1070, "fail", "用户数据更新失败");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$log['remarks'] = '修改成功';
|
|
|
|
|
log_action($log);
|
|
|
|
|
$data['status'] = 200;
|
|
|
|
|