✨ feat(gvg): 添加红点

This commit is contained in:
luying
2023-02-18 22:19:00 +08:00
parent 4b73763e27
commit bfaaba13e0
5 changed files with 112 additions and 9 deletions
+10
View File
@@ -41,6 +41,11 @@ export default class GVGLeagueApply extends BaseModel {
return result;
}
public static async findApplyFromLeagueWithoutPopulate(leagueCode: string) {
const result: GVGLeagueApplyType[] = await GVGLeagueApplyModel.find({ leagueCode, type: GVG_APPLY_TYPE.APPLY }).select('_id').lean();
return result;
}
public static async findApplyFromLeague(leagueCode: string) {
const result: GVGLeagueApplyType[] = await GVGLeagueApplyModel.find({ leagueCode, type: GVG_APPLY_TYPE.APPLY })
.select({ _id: 0, guild: 1, guildCode: 1 })
@@ -63,6 +68,11 @@ export default class GVGLeagueApply extends BaseModel {
return result;
}
public static async findInviteFromGuildWithoutPopulate(guildCode: string) {
const result: GVGLeagueApplyType[] = await GVGLeagueApplyModel.find({ guildCode, type: GVG_APPLY_TYPE.INVITE }).select('_id').lean();
return result;
}
public static async findInviteFromGuild(guildCode: string) {
const result: GVGLeagueApplyType[] = await GVGLeagueApplyModel.find({ guildCode, type: GVG_APPLY_TYPE.INVITE })
.select({ _id: 0, guild: 1, guildCode: 1 })