🐞 fix(gvg): 结算页面将其他城池也返回

This commit is contained in:
luying
2023-03-22 18:06:39 +08:00
parent d98e96c403
commit f289856722
5 changed files with 29 additions and 10 deletions

View File

@@ -49,7 +49,8 @@ export async function getGVGCitiesInfo(configId: number, groupKey: string, leagu
let cities = await GVGCityModel.findGuardCity(configId, groupKey);
let result: GVGCityMapInfo[] = [];
for(let city of cities) {
let obj = new GVGCityMapInfo(city);
let obj = new GVGCityMapInfo(city.cityId);
obj.setCity(city);
if(league) {
let players = (city.players||[]).filter(cur => cur.leagueCode == league.leagueCode);
obj.setTeamCnt(players.length);
@@ -62,6 +63,19 @@ export async function getGVGCitiesInfo(configId: number, groupKey: string, leagu
return result;
}
export async function getAllGVGCitiesInfo(configId: number, groupKey: string, serverType: number) {
let cities = await GVGCityModel.findGuardCity(configId, groupKey);
let result: GVGCityMapInfo[] = [];
for(let [cityId, { mapType }] of gameData.gvgCity) {
if(mapType != serverType) continue;
let obj = new GVGCityMapInfo(cityId);
let city = cities.find(cur => cur.cityId == cityId);
obj.setCity(city);
result.push(obj);
}
return result
}
/**
* 获取内存中队伍的数据结构
*/