feat(gvg): 备战期结束发放未领取邮件

This commit is contained in:
luying
2023-03-07 19:23:37 +08:00
parent 6b79612a5e
commit 129f232e84
8 changed files with 88 additions and 7 deletions

View File

@@ -70,6 +70,7 @@ export enum MAIL_TYPE {
GVG_BATTLE_PLAYER_RANK_REWARD = 40, // 激战期个人排行榜奖励
GVG_GUARD_CITY_REWARD = 41, // 激战期城池占领奖励
LEAGUE_MAIL = 42, // 联军邮件
VESTIGE_REWARD = 43, // 补发遗迹邮件
};
export const SEND_NAME = '系统';

View File

@@ -69,6 +69,17 @@ export default class GVGVestigeLeagueRank extends BaseModel {
public static async receiveRanks(_ids: string[], roleId: string) {
await GVGVestigeLeagueRankModel.updateMany({ _id: { $in: _ids } }, { $push: { receiveMembers: roleId } });
}
public static async receiveManyRanks(arr: { _id: string, roleIds: string[]}[]) {
await GVGVestigeLeagueRankModel.bulkWrite(arr.map(({ _id, roleIds}) => {
return { updateOne: { filter: { _id }, update: { $push: { receiveMembers: roleIds } } } }
}));
}
public static async getAllCanReceiveRanks(configId: number, leagueCodes: string[]) {
let result: GVGVestigeLeagueRankType[] = await GVGVestigeLeagueRankModel.find({ configId, rank: { $gt: 0 }, leagueCode: { $in: leagueCodes } }).lean();
return result;
}
}
export const GVGVestigeLeagueRankModel = getModelForClass(GVGVestigeLeagueRank);

View File

@@ -77,6 +77,11 @@ export default class GVGVestigeSumRank extends BaseModel {
public static async receiveRanks(_ids: string[]) {
await GVGVestigeSumRankModel.updateMany({ _id: { $in: _ids } }, { $set: { isReceived: true } });
}
public static async getAllCanReceiveRanks(configId: number) {
let result: GVGVestigeSumRankType[] = await GVGVestigeSumRankModel.find({ configId: { $lte: configId }, rank: { $gt: 0 }, isReceived: false }).lean();
return result;
}
}
export const GVGVestigeSumRankModel = getModelForClass(GVGVestigeSumRank);

View File

@@ -299,5 +299,12 @@
"sendName": "&",
"content": "%d",
"time": 720
},
{
"id": 43,
"title": "&",
"sendName": "学宫驿使",
"content": "亲爱的百家传人,逐鹿中原本轮备战期已结束,您有奖励尚未领取,现已发送至邮箱,请查收",
"time": 720
}
]