🐞 fix(gvg): 激战期有时areaId为0

This commit is contained in:
luying
2023-02-21 20:54:26 +08:00
parent 9ac146b4b6
commit f15670f158
6 changed files with 36 additions and 7 deletions
+6
View File
@@ -59,6 +59,12 @@ export default class GVGCity extends BaseModel {
return city;
}
// 添加人数
public static async increaseTeam(configId: number, groupKey: string, cityId: number, roleId: string) {
const city: GVGCityType = await GVGCityModel.findOneAndUpdate({ configId, groupKey, cityId, 'players.roleId': roleId }, { $inc: { 'players.$.teamCnt': 1 }}, { new: true }).lean();
return city;
}
// 查询联军驻守情况
public static async findGuardCityByLeague(configId: number, leagueCode: string, select = '') {
const cities: GVGCityType[] = await GVGCityModel.find({ configId, guardLeague: leagueCode, hasGuard: true }).select(select).lean();