活动:修复限时排行榜

This commit is contained in:
luying
2022-05-18 22:26:48 +08:00
parent 6568be2b92
commit a0db79d0a8
6 changed files with 17 additions and 22 deletions

View File

@@ -61,7 +61,6 @@ export abstract class ActivityBase {
this.endTime = moment(activityData.endTime).add(this.delayDay, 'd').valueOf();
this.todayIndex = deltaDays(moment(this.beginTime).toDate(), new Date) + 1;
this.roundIndex = 1;
this.nextRefreshTime = this.endTime;
this.name = activityData.name;
this.isEnable = activityData.isEnable;
this.interval = activityData.interval * 86400;
@@ -102,6 +101,8 @@ export abstract class ActivityBase {
this.roundIndex = Math.ceil((moment(new Date).valueOf() - this.beginTime) / (activityData.interval * 86400000));
this.nextRefreshTime = moment(this.beginTime).add(activityData.interval * (this.roundIndex - 1), 'day').add(activityData.effectDay, 'd').valueOf();
this.todayIndex = Math.ceil(((moment(new Date).valueOf() - this.beginTime) / (24 * 60 * 60 * 1000)));
} else {
this.nextRefreshTime = this.endTime;
}
if(activityData.hideDayByServer > 0) {
let hidOverTime = moment(serverTime * 1000).add(activityData.hideDayByServer, 'd').startOf('d').add(REFRESH_TIME, 'h').valueOf();

View File

@@ -49,8 +49,8 @@ export class TimeLimitRankData extends ActivityBase {
public getRewardByRank(rank: number) {
let result: TimeLimitRankReward;
for(let reward of this.rankRewards) {
if(reward.rank > rank) break;
result = reward;
if(reward.rank >= rank) break;
}
return result;
}
@@ -68,8 +68,8 @@ export class TimeLimitRankData extends ActivityBase {
let dataObj: TimeLimitInDb = JSON.parse(data);
this.rankType = dataObj.rankType;
this.hid = dataObj.hid;
this.rankEndTime = new Date(moment(this.beginTime).add(dataObj.rankEndDay, 'd').format(`YYYY-MM-DD ${dataObj.rankEndTime}`)).getTime() ;
this.sendMailTime = this.rankEndTime + this.sendMailTime * 1000;
this.rankEndTime = new Date(moment(this.beginTime).add(dataObj.rankEndDay - 1, 'd').format(`YYYY-MM-DD ${dataObj.rankEndTime}`)).getTime() ;
this.sendMailTime = this.rankEndTime + dataObj.sendMailTime * 1000;
for(let rank of dataObj.rankRewards) {
this.rankRewards.push(new TimeLimitRankReward(rank));
}