时间:整理时间方法

This commit is contained in:
luying
2021-05-08 19:13:44 +08:00
parent 6f03a96c51
commit 78e3c26a7a
51 changed files with 662 additions and 411 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
import BaseModel from './BaseModel';
import { index, getModelForClass, prop, DocumentType } from '@typegoose/typegoose';
import { nowSeconds, getTodayZeroPoint } from '../pubUtils/timeUtil';
import { nowSeconds, getTimeFun } from '../pubUtils/timeUtil';
@index({ guildCode: 1 })
@@ -37,7 +37,7 @@ export default class WishPoolReport extends BaseModel {
}
//获得day天之前的许愿池战报
public static async getReportsByTime(guildCode: string, day: number) {
let time = getTodayZeroPoint() - day * 24 * 60;
let time = <number>getTimeFun().getBeforeDayWithHour(day);
const reports = await WishPoolReportModel.find({ guildCode, dntTime: {$gte: time}}).sort({ dntTime : -1 });
return reports;
}