Merge remote-tracking branch 'origin/dev' into dev

master
zhengyongxing 5 years ago
commit 1bf19af17e

@ -402,7 +402,7 @@ class UserModel extends Model{
'sdk_version'=>$sdk_version,
'check_time' => time(),
'device_type'=>$device_type,
'device_number' =>$unique_code
'device_number' =>$unique_code ? $unique_code : ''
);
if($register_type==2){
$map['phone']=$phone;
@ -425,7 +425,7 @@ class UserModel extends Model{
$uid = $this->add();
/* // 找该设备绑定的上级推广员 优先找这个表的
if ($unique_code) {
if ($unique_code && $promote_id >0) {
M('device_promote', 'tab_')->add(array(
'user_id' => $uid,
'promote_id' => $promote_id,
@ -1024,7 +1024,7 @@ class UserModel extends Model{
'openid' =>$userinfo['openid'],
'check_time' => time(),
'device_type' => $userinfo['device_type'],
'device_number' => $userinfo['unique_code']
'device_number' => $userinfo['unique_code'] ? $userinfo['unique_code'] : ''
);
/* 添加用户 */
if($this->create($data)){
@ -1118,9 +1118,9 @@ class UserModel extends Model{
$data["id"] = $uid;
$data["login_time"] = NOW_TIME;
$data["login_ip"] = get_client_ip();
$data["device_number"] = $unique_code;
// $data["device_number"] = $unique_code;
$data["last_login_ip"] = $user['login_ip'];
$data["last_device_number"] = $user['device_number'];
$data["last_device_number"] = $user['device_number'] ? $user['device_number'] : '';
$data["token"] = $this->generateToken($uid,$account,$password);
M('user_token','tab_')->startTrans();
@ -1222,7 +1222,7 @@ class UserModel extends Model{
$model = M('User','tab_');
$uid = $user['id'];
$data["id"] = $uid;
$data["device_number"] = $unique_code;
$data["device_number"] = $unique_code ? $unique_code : '';
$data["last_device_number"] = $user['device_number'];
$data["lock_status"] = 0 ;
$model->save($data);

@ -1416,7 +1416,7 @@ class UserController extends BaseController
log_action($log);
if ($res['id']>0) {
$user_play->save($data);
$this->updateLoginRecord($data);
// $this->updateLoginRecord($data); // 取消更新登入记录的角色相关信息
} else {
$data['create_time'] = time();
$data['create_ip'] = get_client_ip();
@ -1431,7 +1431,7 @@ class UserController extends BaseController
Log::write('Duplicate Exception:' .json_encode($e->getMessage()), Log::ERR);
}
$this->updateLoginRecord($data);
// $this->updateLoginRecord($data); // 取消更新登入记录的角色相关信息
}
@ -2466,7 +2466,7 @@ class UserController extends BaseController
$log['type'] = 4;
log_action($log);
// $return = M('UserLoginRecord', 'tab_') -> add($da);
/* // $return = M('UserLoginRecord', 'tab_') -> add($da);
$model = M('UserLoginRecord', 'tab_')->where(['user_id' => $user['id'],'game_id' => $request['game_id']])->order('id DESC')->find();
M('UserLoginRecord', 'tab_')->where(['id' => $model['id']])->setField(['down_time' => NOW_TIME]);
if ($request['state'] == 1) {
@ -2478,7 +2478,19 @@ class UserController extends BaseController
// $this -> set_message(0, "fail", "数据新增失败!");
// }
// } */
$return = M('UserGameLoginRecord', 'tab_') -> add($da);
if ($return) {
if ($request['state'] == 1) {
M('nearby', 'tab_') -> where(['user_id' => $user['id']]) -> setField(['update_time' => time(), 'game_status' => 0]);
}
echo base64_encode(json_encode(array('status' => 200, 'return_msg' => '数据新增成功!')));
} else {
$this -> set_message(0, "fail", "数据新增失败!");
}
}
@ -2791,8 +2803,8 @@ class UserController extends BaseController
$map = array(
'unique_code' => $request['unique_code'],
);
$result = $device_record -> where($map) -> order('create_time desc') -> find();
$duration = 0;
/* $result = $device_record -> where($map) -> order('create_time desc') -> find();
$duration = 0;
$now = time();
if (is_array($result) && $result['mark'] == 1) {
@ -2809,7 +2821,7 @@ class UserController extends BaseController
}
}
} */ // 在线时长不做统计
$request['user_id'] = (!empty($request['user_id'])) ? $request['user_id'] : 0;
$data = array(

Loading…
Cancel
Save