From e8e38e4aec2e2f448f1abb52b8814cf3ba42250d Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Wed, 22 Dec 2021 17:39:35 +0800 Subject: [PATCH] 1 --- webapp/controller/UserController.class.php | 23 +++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/webapp/controller/UserController.class.php b/webapp/controller/UserController.class.php index ea1b7bba..90c9eeaf 100644 --- a/webapp/controller/UserController.class.php +++ b/webapp/controller/UserController.class.php @@ -142,7 +142,8 @@ class UserController extends BaseAuthedController { 'head_frame' => $headFrame, 'level' => 1, 'exp' => 0, - 'rank' => $initRankMeta ? $initRankMeta['rank'] : 0, + 'rank' => $initRankMeta ? $initRankMeta['rank'] : 1, + 'history_best_rank' => $initRankMeta ? $initRankMeta['rank'] : 1, 'score' => $initRankMeta ? $initRankMeta['min_score'] : 0, 'head_id' => $headId, 'hero_id' => $heroId, @@ -378,6 +379,26 @@ class UserController extends BaseAuthedController { 'star_win' => min(100, $starWin), )); } + if (count($userDto['history_seasons']) <= 0) { + $currSeasonMeta = mt\Season::getCurrentSeason(); + array_push($userDto['history_seasons'], + array( + 'season_id' => $currSeasonMeta['id'], + 'total_kills' => 0, + 'game_times' => 0, + 'win_times' => 0, + 'win_rate' => 0, + 'max_kills' => 0, + 'avg_kills' => 0, + 'max_damage_out' => 0, + 'avg_damage_out' => 0, + 'star_kills' => min(100, 0), + 'star_damage' => min(100, 0), + 'star_alive' => min(100, 0), + 'star_recover' => min(100, 0), + 'star_win' => min(100, 0), + )); + } $this->_rspData(array( 'info' => $userDto ));