邮件:删除邮件bug
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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();
|
||||||
|
|||||||
Reference in New Issue
Block a user