邮件:定时邮件优化

This commit is contained in:
luying
2022-02-23 19:06:31 +08:00
parent 38a4c41953
commit 0436215f3a
11 changed files with 281 additions and 111 deletions

View File

@@ -43,6 +43,16 @@ export default class ServerMail extends MailTemp {
return result;
}
public static async findByTimeGap(beforeTime: number, time: number) {
const result: ServerMailType[] = await ServerMailModel.find({ sendTime: { $gt: beforeTime, $lte: time } }).lean();
return result;
}
public static async findBySendTime(time: number) {
const result: ServerMailType[] = await ServerMailModel.find({ sendTime: time }).lean();
return result;
}
/**
* @description 创建邮件
* @param params