feat(邮件): 添加专属邮件

This commit is contained in:
luying
2023-04-06 17:36:44 +08:00
parent ec65f880b7
commit 579ee7846f
7 changed files with 17 additions and 6 deletions

View File

@@ -98,6 +98,7 @@ export default class ServerMail extends MailTemp {
public static async delMailsByRoleId(roleId: string) {
const ids: { _id: string }[] = await ServerMailModel.find(
{
isSp: false,
sendTime:{ $lte: nowSeconds() },
$or: [{
roleStatus: {$elemMatch: {roleId, status: MAIL_STATUS.READ}}, hasGoods:false
@@ -133,7 +134,7 @@ export default class ServerMail extends MailTemp {
* @param lean
*/
public static async findRewardsMails(serverId: number, roleId: string, lean = true) {
const allMails: ServerMailType[] = await ServerMailModel.find({ serverId, sendTime:{$lte: nowSeconds()} }).lean(lean);
const allMails: ServerMailType[] = await ServerMailModel.find({ serverId, sendTime:{$lte: nowSeconds()}, isSp: false }).lean(lean);
let result: ServerMailType[] = [];
for(let mail of allMails) {
let { roleStatus } = mail;