✨ feat(邮件): 添加专属邮件
This commit is contained in:
+2
-2
@@ -87,7 +87,7 @@ export default class Mail extends MailTemp {
|
||||
* @param roleId
|
||||
*/
|
||||
public static async delMailsByRoleId(roleId: string) {
|
||||
const ids: { _id: string }[] = await MailModel.find({ roleId, $or: [{ $and: [{ status: MAIL_STATUS.READ, hasGoods: false }] }, { status: MAIL_STATUS.RECEIVED }], sendTime:{$lte: nowSeconds()} }).select('_id').lean();
|
||||
const ids: { _id: string }[] = await MailModel.find({ roleId, $or: [{ $and: [{ status: MAIL_STATUS.READ, hasGoods: false }] }, { status: MAIL_STATUS.RECEIVED }], sendTime:{$lte: nowSeconds()}, isSp: false }).select('_id').lean();
|
||||
let result: MailType[] = [];
|
||||
for(let _id of ids) {
|
||||
let rec = await MailModel.findByIdAndUpdate(_id, { $set:{ status: MAIL_STATUS.DELETE }}, { new: true }).lean();
|
||||
@@ -128,7 +128,7 @@ export default class Mail extends MailTemp {
|
||||
* @param lean
|
||||
*/
|
||||
public static async findRewardsMails(roleId: string, lean = true) {
|
||||
const result: MailType[] = await MailModel.find({ roleId, status: {$in: [ MAIL_STATUS.CREATE, MAIL_STATUS.READ ] }, sendTime:{$lte: nowSeconds()} }).lean(lean);
|
||||
const result: MailType[] = await MailModel.find({ roleId, status: {$in: [ MAIL_STATUS.CREATE, MAIL_STATUS.READ ] }, sendTime:{$lte: nowSeconds()}, isSp: false }).lean(lean);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user