时间:整理时间方法
This commit is contained in:
@@ -2,8 +2,8 @@ import BaseModel from './BaseModel';
|
||||
import { index, getModelForClass, prop, DocumentType, Ref } from '@typegoose/typegoose';
|
||||
import Role, { RoleType } from './Role';
|
||||
import { genCode } from '../pubUtils/util';
|
||||
import { GUILD_STRUCTURE, GUILD_STATUS, GUILD_PER_PAGE, GUILD_SELECT, REDIS_KEY } from '../consts';
|
||||
import { getCurWeekTime, nowSeconds } from '../pubUtils/timeUtil';
|
||||
import { GUILD_STRUCTURE, GUILD_STATUS, GUILD_PER_PAGE, GUILD_SELECT, REDIS_KEY, SHOP_REFRESH_TYPE } from '../consts';
|
||||
import { getZeroPoint, nowSeconds } from '../pubUtils/timeUtil';
|
||||
import { reduceCe } from '../pubUtils/util';
|
||||
|
||||
class Structure {
|
||||
@@ -229,7 +229,7 @@ export default class Guild extends BaseModel {
|
||||
* @param lean
|
||||
*/
|
||||
public static async resetGuildTrain(code: string, serverId: number, trainLv: number, lean = true) {
|
||||
const time = getCurWeekTime(1, 5);//每周一,5点刷新
|
||||
const time = getZeroPoint(SHOP_REFRESH_TYPE.WEEKLY);//每周一,5点刷新
|
||||
const result = await GuildModel.findOneAndUpdate({ code, status: GUILD_STATUS.RUNNING, serverId, resetTrainTime:{$ne:time}},{$set: {trainId: 1, resetTrainTime: time, trainLv}}, {new: true}).lean(lean);
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user