diff --git a/Application/Home/Controller/QueryController.class.php b/Application/Home/Controller/QueryController.class.php index ce7a00127..a0bc19e67 100644 --- a/Application/Home/Controller/QueryController.class.php +++ b/Application/Home/Controller/QueryController.class.php @@ -1956,7 +1956,7 @@ class QueryController extends BaseController } else { $spendMap['_string'] = '1<>1'; } - $allRecharges = M('spend', 'tab_')->field('count(*) count, sum(cost) cost, game_player_id')->where($gameMap)->group('game_player_id')->select(); + $allRecharges = M('spend', 'tab_')->field('count(*) count, sum(cost) cost, game_player_id')->where($spendMap)->group('game_player_id')->select(); $allRecords = []; foreach ($allRecharges as $recharge) { $allRecords[$recharge['game_player_id']] = $recharge; diff --git a/Application/Home/View/default/Query/gameArpu.html b/Application/Home/View/default/Query/gameArpu.html index 1078c5ddb..ada236dfb 100644 --- a/Application/Home/View/default/Query/gameArpu.html +++ b/Application/Home/View/default/Query/gameArpu.html @@ -196,7 +196,7 @@ end: function () { // layer.open({ type: 2, - title: timetitle + ptitle + '游戏数据', + title: timetitle + ptitle + ' 游戏数据', shadeClose: true, shade: false, maxmin: true, //开启最大化最小化按钮 diff --git a/Application/Sdk/Controller/UserController.class.php b/Application/Sdk/Controller/UserController.class.php index eaa979164..d8a701d54 100644 --- a/Application/Sdk/Controller/UserController.class.php +++ b/Application/Sdk/Controller/UserController.class.php @@ -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", "成功"); }