This commit is contained in:
aozhiwei 2022-09-21 11:37:20 +08:00
commit 97799c70f9
7 changed files with 18 additions and 6 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

@ -2,4 +2,4 @@ function init() {
}
expors.init = init;
exports.init = init;

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

@ -38,11 +38,10 @@ class BattleController extends BaseAuthedController {
'modifytime' => $this->_getNowTime(),
)
);
$this->_rspData($battleDataService->getReward());
}
public function battleReportNew()
{
error_log(json_encode($battleDataService->getReward()));
$this->_rspData(array(
'reward' => $battleDataService->getReward()
));
}
public function getBattleData()

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

@ -70,6 +70,7 @@ class BattleDataService extends BaseService {
'ceg_uplimit' => 0,
'obtain_ceg' => 0,
),
'total_ceg' => 0,
'items' => array()
);
private $rankActivityService = null;
@ -335,6 +336,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'],
@ -620,14 +622,17 @@ class BattleDataService extends BaseService {
if ($heroPvpCeg > 0) {
$heroPvpCeg = Hero::gainGoldPvp($this->heroDto, $heroPvpCeg);
$this->reward['hero']['obtain_ceg'] = $this->heroDto['current_pvp_get_ceg'] + $heroPvpCeg;
$this->reward['total_ceg'] += $heroPvpCeg;
}
if ($weaponPvpCeg1 > 0) {
$weaponPvpCeg1 = Gun::gainGoldPvp($this->weapon1Dto, $weaponPvpCeg1);
$this->reward['weapon1']['obtain_ceg'] = $this->weapon1Dto['current_pvp_get_ceg'] + $weaponPvpCeg1;
$this->reward['total_ceg'] += $weaponPvpCeg1;
}
if ($weaponPvpCeg2 > 0) {
$weaponPvpCeg2 = Gun::gainGoldPvp($this->weapon1Dto, $weaponPvpCeg2);
$this->reward['weapon2']['obtain_ceg'] = $this->weapon2Dto['current_pvp_get_ceg'] + $weaponPvpCeg2;
$this->reward['total_ceg'] += $weaponPvpCeg2;
}
error_log(json_encode(array(
'new_heroPvpCeg' => $heroPvpCeg,