后台:定时邮件
This commit is contained in:
@@ -5,6 +5,7 @@ import BaseModel from './BaseModel';
|
||||
import { getModelForClass, prop, DocumentType, mongoose, ReturnModelType } from '@typegoose/typegoose';
|
||||
import { GM_MAIL_STATUS, GM_MAIL_TYPE, MAIL_TIME_TYPE } from '../consts';
|
||||
import { SearchMailParam } from '../domain/backEndField/search';
|
||||
import { getCurDay, nowSeconds } from '../pubUtils/timeUtil';
|
||||
|
||||
class Reward {
|
||||
@prop({ required: true })
|
||||
@@ -142,6 +143,15 @@ export default class GMMail extends BaseModel {
|
||||
return result;
|
||||
}
|
||||
|
||||
public static async findCircleMails(env: string) {
|
||||
const result: GMMailType[] = await GMMailModel.find({
|
||||
timeType: MAIL_TIME_TYPE.CIRCLE,
|
||||
circleStart: { $lt: nowSeconds() }, circleEnd: { $gte: nowSeconds() },
|
||||
circleDay: { $in: [0, getCurDay(true)] }, 'receivers.env': env,
|
||||
status: GM_MAIL_STATUS.PASS
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user