时间:整理时间方法

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 BaseModel from './BaseModel';
import { index, getModelForClass, prop, DocumentType, Ref } from '@typegoose/typegoose';
import Role, { RoleType } from './Role';
import { GUILD_AUTH, USER_GUILD_STATUS, GUILD_JOB } from '../consts';
import { getTodayZeroDate, nowSeconds } from '../pubUtils/timeUtil';
import { getZeroPointD, nowSeconds } from '../pubUtils/timeUtil';
import { ARMY } from '../pubUtils/dicParam';
class ActiveRecord {
@prop({ required: true })
@@ -187,7 +187,7 @@ export default class UserGuild extends BaseModel {
}
public static async getWishPoolGoods(guildCode: string, select?: string, lean = true) {
const userGuilds: UserGuildType[] = await UserGuildModel.find({ guildCode, status: USER_GUILD_STATUS.ON, refTimeDaily: { $gte: getTodayZeroDate() } })
const userGuilds: UserGuildType[] = await UserGuildModel.find({ guildCode, status: USER_GUILD_STATUS.ON, refTimeDaily: { $gte: getZeroPointD() } })
.select(select).lean(lean);
return userGuilds;
}