邮件:删除邮件bug

This commit is contained in:
luying
2021-08-05 14:35:16 +08:00
parent 4dcf1a8930
commit 7a46bc3dec
2 changed files with 5 additions and 5 deletions
+3 -3
View File
@@ -56,7 +56,7 @@ export default class GroupMail extends MailTemp {
$or: [{ $or: [{
roleStatus: {$elemMatch: {roleId, status: MAIL_STATUS.READ}}, hasGoods:false roleStatus: {$elemMatch: {roleId, status: MAIL_STATUS.READ}}, hasGoods:false
}, { }, {
roleStatus: {$elemMatch: {roleId, status: MAIL_STATUS.RECEIVED}}, hasGoods: true roleStatus: {$elemMatch: {roleId, status: MAIL_STATUS.RECEIVED}}
}] }]
}, },
{ $set:{ 'roleStatus.$.status': MAIL_STATUS.DELETE } }, { $set:{ 'roleStatus.$.status': MAIL_STATUS.DELETE } },
@@ -76,7 +76,7 @@ export default class GroupMail extends MailTemp {
$or: [{ $or: [{
roleStatus: {$elemMatch: {roleId, status: MAIL_STATUS.READ}}, hasGoods:false roleStatus: {$elemMatch: {roleId, status: MAIL_STATUS.READ}}, hasGoods:false
}, { }, {
roleStatus: {$elemMatch: {roleId, status: MAIL_STATUS.RECEIVED}}, hasGoods: true roleStatus: {$elemMatch: {roleId, status: MAIL_STATUS.RECEIVED}}
}] }]
},).select('_id').lean(); },).select('_id').lean();
const result: GroupMailType[] = []; const result: GroupMailType[] = [];
@@ -118,7 +118,7 @@ export default class GroupMail extends MailTemp {
} }
public static async findReadAndRewardsMails(roleId: string, lean = true) { public static async findReadAndRewardsMails(roleId: string, lean = true) {
const ids: GroupMailType[] = await GroupMailModel.find({ sendTime:{$lte: nowSeconds()}, roleStatus: { $elemMatch: { roleId, $or:[ {$and: [{status: MAIL_STATUS.READ}, { hasGoods: true }]},{status: MAIL_STATUS.RECEIVED} ] } } }).select('_id').lean(lean); const ids: GroupMailType[] = await GroupMailModel.find({ sendTime:{$lte: nowSeconds()}, roleStatus: { $elemMatch: { roleId, $or:[ {$and: [{status: MAIL_STATUS.READ}, { hasGoods: false }]},{status: MAIL_STATUS.RECEIVED} ] } } }).select('_id').lean(lean);
return ids; return ids;
} }
+2 -2
View File
@@ -66,7 +66,7 @@ export default class ServerMail extends MailTemp {
$or: [{ $or: [{
roleStatus: {$elemMatch: {roleId, status: MAIL_STATUS.READ}}, hasGoods:false roleStatus: {$elemMatch: {roleId, status: MAIL_STATUS.READ}}, hasGoods:false
}, { }, {
roleStatus: {$elemMatch: {roleId, status: MAIL_STATUS.RECEIVED}}, hasGoods: true roleStatus: {$elemMatch: {roleId, status: MAIL_STATUS.RECEIVED}}
}] }]
}, },
{ $set:{ 'roleStatus.$.status': MAIL_STATUS.DELETE, $push: { 'delRoles': roleId } } }, { $set:{ 'roleStatus.$.status': MAIL_STATUS.DELETE, $push: { 'delRoles': roleId } } },
@@ -87,7 +87,7 @@ export default class ServerMail extends MailTemp {
$or: [{ $or: [{
roleStatus: {$elemMatch: {roleId, status: MAIL_STATUS.READ}}, hasGoods:false roleStatus: {$elemMatch: {roleId, status: MAIL_STATUS.READ}}, hasGoods:false
}, { }, {
roleStatus: {$elemMatch: {roleId, status: MAIL_STATUS.RECEIVED}}, hasGoods: true roleStatus: {$elemMatch: {roleId, status: MAIL_STATUS.RECEIVED}}
}] }]
} }
).select('_id').lean(); ).select('_id').lean();