🐞 fix(gvg): 激战期离开城池减少玩家人数不upsert
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user