✨ feat(gvg): 激战期数据补充、排行榜等
This commit is contained in:
+14
-2
@@ -63,8 +63,20 @@ export default class GVGCity extends BaseModel {
|
||||
}
|
||||
|
||||
// 查询联军驻守情况
|
||||
public static async findGuardCityByLeague(configId: number, groupId: number, serverType: number, ) {
|
||||
const cities: GVGCityType[] = await GVGCityModel.find({ configId, groupId, serverType, hasGuard: true }).lean();
|
||||
public static async findGuardCityByLeague(configId: number, leagueCode: string, select = '') {
|
||||
const cities: GVGCityType[] = await GVGCityModel.find({ configId, guardLeague: leagueCode, hasGuard: true }).select(select).lean();
|
||||
return cities
|
||||
}
|
||||
|
||||
// 查询联军驻守情况
|
||||
public static async checkLeagueHasGuard(configId: number, leagueCode: string) {
|
||||
return await GVGCityModel.exists({ configId, guardLeague: leagueCode, hasGuard: true });
|
||||
}
|
||||
|
||||
// 查询联军驻守情况
|
||||
public static async findGuardCity(configId: number, groupId: number, serverType: number, select = '') {
|
||||
let cities: GVGCityType[] = await GVGCityModel.find({ configId: configId + 1, groupId, serverType, hasGuard: true }).select(select).lean();
|
||||
if(cities.length == 0) cities = await GVGCityModel.find({ configId, groupId, serverType, hasGuard: true }).select(select).lean();
|
||||
return cities
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user