邮件:定时邮件优化

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
+8
View File
@@ -111,7 +111,15 @@ export default class Mail extends MailTemp {
return result;
}
public static async findByTimeGap(beforeTime: number, time: number) {
const result: MailType[] = await MailModel.find({ sendTime: { $gt: beforeTime, $lte: time } }).lean();
return result;
}
public static async findBySendTime(time: number) {
const result: MailType[] = await MailModel.find({ sendTime: time }).lean();
return result;
}
/**
* 查询有奖励的邮件