feat(gvg): 添加激战期动态

This commit is contained in:
luying
2023-02-20 13:49:14 +08:00
parent bfaaba13e0
commit abe3956214
6 changed files with 114 additions and 9 deletions
+11 -2
View File
@@ -45,11 +45,20 @@ export default class GVGRec extends BaseModel {
}
// 查询城池战报
public static async findByCity(cityId: number, configId: number) {
const result: GVGRecType[] = await GVGRecModel.find({ cityId, configId }, { _id: 0, recId: 1, params: 1, createTime: 1 }).sort({ createTime: -1 }).limit(50).lean();
public static async findBattleRecByCity(configId: number, groupId: number, serverType: number, cityId: number) {
const result: GVGRecType[] = await GVGRecModel.find({ cityId, configId, groupId, serverType, type: GVG_REC_TYPE.BATTLE_BY_CITY }, { _id: 0, recId: 1, params: 1, createTime: 1 }).sort({ createTime: -1 }).limit(50).lean();
return result;
}
public static async findBattleRecByLeague(configId: number, leagueCode: string) {
const result: GVGRecType[] = await GVGRecModel.find({ configId, leagueCode, type: GVG_REC_TYPE.BATTLE_BY_LEAGUE }, { _id: 0, recId: 1, params: 1, createTime: 1 }).sort({ createTime: -1 }).limit(50).lean();
return result;
}
public static async findBattleRecByRole(configId: number, roleId: string, leagueCode: string) {
const result: GVGRecType[] = await GVGRecModel.find({ configId, roleId, leagueCode, type: GVG_REC_TYPE.BATTLE_BY_ROLE }, { _id: 0, recId: 1, params: 1, createTime: 1 }).sort({ createTime: -1 }).limit(50).lean();
return result;
}
}
export const GVGRecModel = getModelForClass(GVGRec);