From ee5811c5ba8fd08486b117fe3406d0f6c860c7da Mon Sep 17 00:00:00 2001 From: hujiabin Date: Wed, 2 Nov 2022 11:35:05 +0800 Subject: [PATCH] 1 --- webapp/controller/SeasonController.class.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/webapp/controller/SeasonController.class.php b/webapp/controller/SeasonController.class.php index 2fd55d8d..d0980b45 100644 --- a/webapp/controller/SeasonController.class.php +++ b/webapp/controller/SeasonController.class.php @@ -136,13 +136,20 @@ class SeasonController extends BaseAuthedController { $winTimes = getXVal($seasonBattleData, 'total_win_times', 0); $topTenTimes = getXVal($seasonBattleData, 'total_top_ten_times', 0); $totalKills = getXVal($seasonBattleData, 'total_kills_times', 0); + $temp = $gameTimes-$winTimes ? $gameTimes-$winTimes:0; + if (! $temp){ + $kill_killed = 0; + }else{ + $kill_killed = round($totalKills/$temp,2); + } + $currRankSeasonHistory= array( 'season_id' => $seasonDb['season_id'], // 'total_kills' => $totalKills, 'game_times' => $gameTimes, 'win_times' => $winTimes, 'top_ten_times' => $topTenTimes, - 'kill_killed' => round($totalKills/($gameTimes-$winTimes),2), + 'kill_killed' => $kill_killed, ); } if (!$currRankSeasonHistory){