时间:整理时间方法

This commit is contained in:
luying
2021-05-08 19:09:51 +08:00
parent 6f03a96c51
commit 78e3c26a7a
51 changed files with 662 additions and 411 deletions

View File

@@ -2,7 +2,7 @@ import { ActivityModelType } from '../../db/Activity';
import { ActivityBase } from './activityField';
import { prop } from '@typegoose/typegoose';
import { UserGachaType } from '../../db/UserGacha';
import { getAfterDateByDay } from '../../pubUtils/timeUtil';
import { getTimeFun } from '../../pubUtils/timeUtil';
import { DicGacha } from '../../pubUtils/dictionary/DicGacha';
import { GACHA_OCCUPY_HID } from '../../consts';
import { gameData } from '../../pubUtils/data';
@@ -31,7 +31,8 @@ export class GachaData extends ActivityBase {
this.pickHero = userGacha.pickHero;
this.freeCount = userGacha.freeCount;
if(dicGacha.free.count > 0) {
this.refFreeTime = getAfterDateByDay(userGacha.refFreeTime, dicGacha.free.day);
let f = getTimeFun(userGacha.refFreeTime);
this.refFreeTime = <number>f.getAfterDayWithHour(dicGacha.free.day);
}
this.count = userGacha.count;
this.floor = userGacha.floor;
@@ -97,7 +98,8 @@ export class GachaListReturn {
if(userGacha) {
this.freeCount = userGacha.freeCount;
if(dicGacha.free.count > 0) {
this.refFreeTime = getAfterDateByDay(userGacha.refFreeTime, dicGacha.free.day);
let f = getTimeFun(userGacha.refFreeTime);
this.refFreeTime = <number>f.getAfterDayWithHour(dicGacha.free.day);
}
this.count = userGacha.count;
this.floor = getFloorStatus(dicGacha.id, userGacha.floor);