🐞 fix(gvg): 结算页面将其他城池也返回
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取内存中队伍的数据结构
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user