🐞 fix(gvg): 联军信息变动同步

This commit is contained in:
luying
2023-02-27 21:54:54 +08:00
parent 1f04496865
commit a89692f4ef
11 changed files with 121 additions and 11 deletions
+7
View File
@@ -113,6 +113,13 @@ export default class GVGCity extends BaseModel {
const cities: GVGCityType[] = await GVGCityModel.find({ configId, hasGuard: true }).lean();
return cities
}
public static async updateLeagueInfo(leagueCode: string, leagueName: string, icon: number) {
let updateInfo: GVGCityUpdate = {};
if(leagueName != undefined) updateInfo.guardLeagueName = leagueName;
if(icon != undefined) updateInfo.guardLeagueIcon = icon;
await GVGCityModel.updateMany({ guardLeague: leagueCode }, { $set: updateInfo });
}
}