邮件:定时循环邮件

This commit is contained in:
luying
2022-05-21 16:26:00 +08:00
parent 367208f780
commit 03bb62e60b
11 changed files with 31 additions and 15 deletions

View File

@@ -498,6 +498,7 @@ export const STATUS = {
GM_MARQUEE_CANCEL_ERR: { code: 60023, simStr: '取消失败' },
GM_MAIL_NOT_FOUND: { code: 60024, simStr: '未找到该邮件' },
GM_MAIL_HAS_SENT: { code: 60025, simStr: '邮件已经审批过了' },
GM_MAIL_CAN_NOT_SENT: { code: 60026, simStr: '邮件不可发送' },
// 支付相关状态 70000 - 79999
NO_PRODUCT_ID: { code: 70001, simStr: '无效商品' },
NO_PAY_TYPE: { code: 70002, simStr: '无效支付类型' },

View File

@@ -33,6 +33,7 @@ export default class GroupMail extends MailTemp {
{'roleStatus.roleId': roleId},
{'roleStatus.status': { $in: [ MAIL_STATUS.CREATE, MAIL_STATUS.READ, MAIL_STATUS.RECEIVED ] }}
],
sendTime: { $lte: nowSeconds() } ,
endTime: { $gte: nowSeconds() }
}).populate('mail').lean();
return result;

View File

@@ -21,6 +21,7 @@ export default class Mail extends MailTemp {
const result: MailType[] = await MailModel.find({
roleId,
status: { $in: [ MAIL_STATUS.CREATE, MAIL_STATUS.READ, MAIL_STATUS.RECEIVED ] },
sendTime: { $lte: nowSeconds()} ,
endTime: { $gte: nowSeconds() }
}).populate('mail').lean();
return result;

View File

@@ -33,6 +33,7 @@ export default class ServerMail extends MailTemp {
const result: ServerMailType[] = await ServerMailModel.find({
serverId,
delRoles: { $ne: roleId },
sendTime: { $lte: nowSeconds() } ,
endTime: { $gte: nowSeconds() }
}).populate('mail').lean();
return result;