邮件:删除邮件bug

This commit is contained in:
luying
2021-08-05 14:35:11 +08:00
parent 4dcf1a8930
commit 7a46bc3dec
2 changed files with 5 additions and 5 deletions

View File

@@ -56,7 +56,7 @@ export default class GroupMail extends MailTemp {
$or: [{
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 } },
@@ -76,7 +76,7 @@ export default class GroupMail extends MailTemp {
$or: [{
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();
const result: GroupMailType[] = [];
@@ -118,7 +118,7 @@ export default class GroupMail extends MailTemp {
}
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;
}