|
|
|
@ -1168,10 +1168,11 @@ class UserController extends BaseController
|
|
|
|
|
$user = M('user', 'tab_');
|
|
|
|
|
$user_data = $user -> find($user_id);
|
|
|
|
|
|
|
|
|
|
$gameName = get_game_name($request['game_id']);
|
|
|
|
|
$data['promote_id'] = $request['promote_id'];
|
|
|
|
|
$data['promote_account'] = get_promote_account($request['promote_id']);
|
|
|
|
|
$data['game_id'] = $request['game_id'];
|
|
|
|
|
$data['game_name'] = get_game_name($request['game_id']);
|
|
|
|
|
$data['game_name'] = $gameName;
|
|
|
|
|
$data['server_id'] = $request['server_id'];
|
|
|
|
|
$data['server_name'] = $request['server_name'];
|
|
|
|
|
$data['role_name'] = $request['game_player_name'];
|
|
|
|
@ -1191,9 +1192,29 @@ class UserController extends BaseController
|
|
|
|
|
$user_play->save($data);
|
|
|
|
|
$this->updateLoginRecord($data);
|
|
|
|
|
} else {
|
|
|
|
|
$data['create_time'] = time();
|
|
|
|
|
$data['create_ip'] = get_client_ip();
|
|
|
|
|
// $data['create_device_number'] = time();
|
|
|
|
|
|
|
|
|
|
$user_play->add($data);
|
|
|
|
|
$this->updateLoginRecord($data);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$server = M('server', 'tab_')->where(['server_id' => $request['server_id'], 'game_id' => $request['game_id']])->find();
|
|
|
|
|
if (empty($server)) {
|
|
|
|
|
$serverData = [
|
|
|
|
|
'game_id' => $request['game_id'],
|
|
|
|
|
'game_name' => $gameName,
|
|
|
|
|
'server_name' => $request['server_name'],
|
|
|
|
|
'server_num' => $request['server_id'],
|
|
|
|
|
'server_id' => $request['server_id'],
|
|
|
|
|
'server_version' => $request["sdk_version"],
|
|
|
|
|
'create_time' => time(),
|
|
|
|
|
'start_time' => time(),
|
|
|
|
|
];
|
|
|
|
|
M('server', 'tab_')->data($serverData)->add();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$this -> set_message(200, "success", "成功");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|