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