添加天梯排行榜,修复setHour有时差的bug
This commit is contained in:
@@ -4,7 +4,7 @@ import { RoleModel } from '../db/Role';
|
||||
import { PvpDefenseModel } from '../db/PvpDefense';
|
||||
|
||||
import { getWarJsons, getGamedata } from '../pubUtils/gamedata';
|
||||
import { decodeStr, resResult } from '../pubUtils/util';
|
||||
import { decodeStr, resResult, setLocalHours } from '../pubUtils/util';
|
||||
import { WAR_JSON_ATTRIBUTE_TYPE } from '../consts/consts';
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ export async function getCEScaleAndRange(roleId: string, curDicExpedition: any)
|
||||
// 匹配,判断是不是新手期
|
||||
const role = await RoleModel.findByRoleId(roleId);
|
||||
let now = new Date();
|
||||
let today = now.setHours(0,0,0,0);
|
||||
let today = setLocalHours(0, now);
|
||||
let isNew = today - role.createdAt.getTime() <= 3*24*60*60*1000;
|
||||
let scale = isNew?curDicExpedition.CEScaleNew:curDicExpedition.CEScale;
|
||||
let range = isNew?curDicExpedition.CERangeNew:curDicExpedition.CERange;
|
||||
|
||||
Reference in New Issue
Block a user