diff --git a/webapp/services/BattleDataService.php b/webapp/services/BattleDataService.php index fb401651..0eebb389 100644 --- a/webapp/services/BattleDataService.php +++ b/webapp/services/BattleDataService.php @@ -66,6 +66,7 @@ class BattleDataService extends BaseService { private $weapon1Dto = null; private $weapon2Dto = null; private $currSeasonMeta = null; + private $oldScore = null; private $reward = array( 'hero' => array( @@ -205,7 +206,7 @@ class BattleDataService extends BaseService { "battle_end_time" => myself()->_getNowTime(), "current_level_class" => $user['rank'], "current_level_class_score" => $user['score'], -// "level_class_score_chg" => 0, // 排位分改变 + "level_class_score_chg" => $user['score']-$this->oldScore, // 排位分改变 "pve_rank_score" => getReqVal('pve_rank_score', 0), "pve_kill_boss" => getReqVal('pve_kill_boss', 0), "pve_instance_id" => getReqVal('pve_instance_id', 0), @@ -455,10 +456,12 @@ class BattleDataService extends BaseService { private function updateScore() { $userInfo = myself()->_getOrmUserInfo(); + $this->oldScore = $userInfo['score']; $newRank = $userInfo['rank']; $newScore = FormulaService::calcBattleAfterRankScore($userInfo,$_REQUEST); //赛后排位积分 $newElo = FormulaService::calcUserEloValue($userInfo,$_REQUEST); //赛后elo积分 mt\Rank::calcNewRankAndScore( $newRank, $newScore); + if ( $newScore != $userInfo['score'] ) { myself()->_updateUserInfo(array( 'rank' => $newRank,