This commit is contained in:
hujiabin 2022-09-21 11:10:29 +08:00
parent bfb9d35d6a
commit 7967e2eed6
5 changed files with 9 additions and 0 deletions

View File

@ -192,6 +192,8 @@ class UserDetailInfo(object):
['hero_id', 0, '当前使用的英雄ID'],
['current_rank', 0, '当前段位'],
['history_best_rank', 0, '历史最高段位'],
['current_rank_score', 0, '当前赛季排位分'],
['history_best_rank_score', 0, '历史最高赛季排位分'],
['like_count', 0, '点赞次数'],
['!history_seasons', [UserHisSeason()], '历史打过的赛季列表'],
]

View File

@ -39,6 +39,7 @@ CREATE TABLE `t_user` (
`rank` int(11) NOT NULL DEFAULT '0' COMMENT '段位',
`history_best_rank` int(11) NOT NULL DEFAULT '0' COMMENT '历史最高段位',
`score` int(11) NOT NULL DEFAULT '0' COMMENT '积分',
`history_best_score` int(11) NOT NULL DEFAULT '0' COMMENT '历史最高积分',
`gold` bigint NOT NULL DEFAULT '0' COMMENT '金币',
`diamond` bigint NOT NULL DEFAULT '0' COMMENT '钻石',
`hero_id` int(11) NOT NULL DEFAULT '0' COMMENT '当前上阵英雄id',

View File

@ -212,6 +212,7 @@ class UserController extends BaseAuthedController {
'rank' => $initRankMeta ? $initRankMeta['rank'] : 1,
'history_best_rank' => $initRankMeta ? $initRankMeta['rank'] : 1,
'score' => $initRankMeta ? $initRankMeta['min_score'] : 0,
'history_best_score' => $initRankMeta ? $initRankMeta['min_score'] : 0,
'head_id' => $headId,
'hero_id' => $heroId,
'last_season_id' => $currSeasonMeta ? $currSeasonMeta['id'] : 0,
@ -472,6 +473,8 @@ class UserController extends BaseAuthedController {
}
$userDto = User::info($userDb);
$userDto['current_rank'] = $userDb['rank'];
$userDto['current_rank_score'] = $userDb['score'];
$userDto['history_best_rank_score'] = $userDb['history_best_score'];
$userDto['history_seasons'] = array();
$seasonDbs = Season::getHistorySeasons($targetId);
foreach ($seasonDbs as $seasonDb) {

View File

@ -38,6 +38,7 @@ class User extends BaseModel {
'rank' => $row['rank'],
'history_best_rank' => $row['history_best_rank'],
'score' => $row['score'],
'history_best_score' => $row['history_best_score'],
'gold' => $row['gold'],
'diamond' => $row['diamond'],
'hero_id' => $row['hero_id'],
@ -66,6 +67,7 @@ class User extends BaseModel {
'rank' => $row['rank'],
'history_best_rank' => $row['history_best_rank'],
'score' => $row['score'],
'history_best_score' => $row['history_best_score'],
'gold' => $row['gold'],
'diamond' => $row['diamond'],
'hero_id' => $row['hero_id'],

View File

@ -335,6 +335,7 @@ class BattleDataService extends BaseService {
'rank' => $newRank,
'score' => $newScore,
'history_best_rank' => max($userInfo['rank'], $newRank),
'history_best_score' => max($userInfo['score'], $newScore),
'score_modifytime' => myself()->_getNowTime(),
'best_rank_modifytime' => $newRank > $userInfo['rank'] ?
myself()->_getNowTime() : $userInfo['best_rank_modifytime'],