🐞 fix(gvg): 激战期离开城池减少玩家人数不upsert

This commit is contained in:
luying
2023-02-21 16:29:27 +08:00
parent 0722593e1d
commit 22b3dbc551

View File

@@ -55,7 +55,7 @@ export default class GVGCity extends BaseModel {
// 减少人数
public static async decreasePlayer(configId: number, groupKey: string, cityId: number, roleId: string) {
const city: GVGCityType = await GVGCityModel.findOneAndUpdate({ configId, groupKey, cityId, 'players.roleId': roleId }, { $inc: { userCnt: -1 }, $pull: { players: { roleId } }}, { new: true, upsert: true }).lean();
const city: GVGCityType = await GVGCityModel.findOneAndUpdate({ configId, groupKey, cityId, 'players.roleId': roleId }, { $inc: { userCnt: -1 }, $pull: { players: { roleId } }}, { new: true }).lean();
return city;
}