时间:整理时间方法

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

@@ -4,7 +4,7 @@ import { TASK_TYPE, ABI_STAGE, WAR_TYPE, GUILD_JOB, TASK_FUN_TYPE, FUNCS_ID } fr
import { UserTaskRecModel, UserTaskRecType } from '../db/UserTaskRec'
import { RoleType, RoleModel } from '../db/Role';
import { TaskParam, TaskListReturn } from '../domain/roleField/task';
import { getTodayZeroPoint } from './timeUtil';
import { getZeroPoint } from './timeUtil';
import { HeroType } from '../db/Hero';
import { EquipType, EquipModel } from '../db/Equip';
import { ItemInter } from './interface';
@@ -35,7 +35,7 @@ export async function checkTaskWithRole(roleId: string, taskType: number, role:
let pushMessage = new Array<TaskListReturn>();
if (taskType == TASK_TYPE.LOGIN_SUM) {
let today = getTodayZeroPoint();
let today = getZeroPoint();
if (today > role.loginTime) {
pushMessage = await checkTask(roleId, taskType, 1, true, {}, funcs);
//成长任务-累计登录游戏天数
@@ -43,7 +43,7 @@ export async function checkTaskWithRole(roleId: string, taskType: number, role:
}
}
else if (taskType == TASK_TYPE.LOGIN_SERIES) {
let today = getTodayZeroPoint();
let today = getZeroPoint();
if (today > role.loginTime) {
if (today - role.loginTime > 24 * 60 * 60) {
pushMessage = await checkTask(roleId, taskType, 1, false, {}, funcs);