diff --git a/webapp/controller/TempToolsController.class.php b/webapp/controller/TempToolsController.class.php new file mode 100644 index 00000000..064cab90 --- /dev/null +++ b/webapp/controller/TempToolsController.class.php @@ -0,0 +1,44 @@ +_getMysql($targetId); + $data = array(); + $survivalTime = 0; + { + $rows = SqlHelper::ormSelect( + $conn, + 't_battle_record', + array( + 'account_id' => $targetId + ) + ); + foreach ($rows as $row) { + $reqObj = json_decode($row['request'], true); + $reqObj['start_time'] = $reqObj['game_time'] - + $reqObj['alive_time']/1000; + $survivalTime += $reqObj['alive_time']/1000; + array_push($data, $reqObj); + } + } + usort($data, function ($a, $b) { + return $a['start_time'] < $b['start_time']; + }); + myself()->_rspData(array( + 'battle_times' => count($data), + 'survival_time' => $survivalTime, + 'data' => $data + )); + } + +}