This commit is contained in:
hujiabin 2023-03-27 16:51:53 +08:00
parent 9ac15bd37c
commit 56ff5f5856

View File

@ -775,10 +775,11 @@ class UserController extends BaseAuthedController {
if ($last_ranking_time && floor((myself()->_getNowTime()-$last_ranking_time)/86400) >= 7){ if ($last_ranking_time && floor((myself()->_getNowTime()-$last_ranking_time)/86400) >= 7){
$userDb = $this->_getOrmUserInfo(); $userDb = $this->_getOrmUserInfo();
$rank_key = mt\Rank::getRankById($userDb['rank'])?mt\Rank::getRankById($userDb['rank'])['rank_order2']:0; $rank_key = mt\Rank::getRankById($userDb['rank'])?mt\Rank::getRankById($userDb['rank'])['rank_order2']:0;
$paramMeta = mt\Parameter::getByName('rank_pass_point'); $paramMeta = mt\Parameter::getByName('rank_point_reduce');
if ($paramMeta){ if ($paramMeta){
$valArr = explode('|',$paramMeta['param_value']); $param_value = explode('|',$paramMeta['param_value']);
$deductScore = $valArr[$rank_key-1]; $deductScore = $param_value[$rank_key-1];
if ($deductScore>0){
$newRank = $userDb['rank']; $newRank = $userDb['rank'];
$newScore = $userDb['score'] - $deductScore; $newScore = $userDb['score'] - $deductScore;
mt\Rank::calcNewRankAndScore( $newRank, $newScore); mt\Rank::calcNewRankAndScore( $newRank, $newScore);
@ -787,6 +788,8 @@ class UserController extends BaseAuthedController {
'score' => $newScore, 'score' => $newScore,
)); ));
} }
}
} }
} }