红点:修复pvp推送

This commit is contained in:
luying
2021-06-10 10:54:21 +08:00
parent b026a20496
commit 16e2a18838

View File

@@ -57,7 +57,9 @@ export async function pushData(role: RoleType, session: FrontendOrBackendSession
for(let type of modules) {
if(notIncludeModule.indexOf(type) == -1) {
let data = await getModuleData(type, { role, session }, guildData);
pushEntryData(type, roleId, sid, data);
if(data) {
pushEntryData(type, roleId, sid, data);
}
}
}
pushEntryEnd(roleId, sid);
@@ -171,18 +173,14 @@ async function getTowerEntryData(role: RoleType) {
* @param roleId
*/
async function getPvpEntryData(roleId: string) {
let pvpSeasonResult = await PvpSeasonResultModel.getPvpSeasonResult(roleId);
if(!pvpSeasonResult) return false;
let { oldSeasonData, show} = pvpSeasonResult;
// 旧赛季结算的时候会在pvpSeasonResult表中存上一赛季的时间并更新show字段
let hasSeasonReward = oldSeasonData.seasonEndTime <= nowSeconds() && show;
let pvpDefense = await PvpDefenseModel.findByRoleIdIncludeAll(roleId);
if(pvpDefense) {
let { pvpDefense, } = await findPvpDefAllByRoleId(roleId);
let { challengeCnt, receivedBox, score } = pvpDefense;
let { challengeCnt, receivedBox, score, hisScore } = pvpDefense;
return { hasSeasonReward, challengeCnt, score, receivedBox }
return { challengeCnt, score, hisScore, receivedBox }
} else {
return null
}
}