🐞 fix(gvg): 修复激战期离开战场逻辑

This commit is contained in:
luying
2023-02-22 11:01:09 +08:00
parent e2e901dc1b
commit cfed1f1430
5 changed files with 40 additions and 16 deletions
+6
View File
@@ -143,6 +143,12 @@ export default class GVGTeam extends BaseModel {
return result;
}
// 离开队伍
public static async leaveCity(roleId: string) {
let res = await GVGTeamModel.updateMany({ roleId }, { $set: { cityId: 0, areaId: 0, pointId: 0 } });
return !!res["ok"];
}
// 查找角色队伍数
public static async getTeamCntByRole(roleId: string) {
const teams: GVGTeamType[] = await GVGTeamModel.find({ roleId }).select('teamCode').lean();