🐞 fix(gvg): 更新gvg战斗返回
This commit is contained in:
@@ -104,7 +104,8 @@ export default class GVGCity extends BaseModel {
|
||||
}
|
||||
|
||||
public static async findByConfigAndGroup(configId: number, groupKey: string) {
|
||||
const cities: GVGCityType[] = await GVGCityModel.find({ configId, groupKey, hasGuard: true }).lean();
|
||||
let cities: GVGCityType[] = await GVGCityModel.find({ configId: configId + 1, groupKey, hasGuard: true }).lean();
|
||||
if(!cities || cities.length == 0) cities = await GVGCityModel.find({ configId, groupKey, hasGuard: true }).lean();
|
||||
return cities
|
||||
}
|
||||
|
||||
|
||||
@@ -39,14 +39,14 @@ export default class GVGCityAreaPoint extends BaseModel {
|
||||
let { configId, groupKey, leagueCode, leagueName, roleId, roleName, teamCode } = team;
|
||||
await GVGCityAreaPointModel.findOneAndUpdate({ configId, groupKey, pointId }, { $setOnInsert: { teamCode: '' }}, { upsert: true });
|
||||
let result: GVGCityAreaPointType = await GVGCityAreaPointModel.findOneAndUpdate(
|
||||
{ configId, groupKey, pointId },
|
||||
{ configId, groupKey, pointId, teamCode: '' },
|
||||
{ $set: { cityId, areaId, leagueCode, leagueName, roleId, roleName, teamCode } },
|
||||
{ new: true }).lean();
|
||||
return result;
|
||||
}
|
||||
|
||||
public static async leavePoint(configId: number, groupKey: string, pointId: number) {
|
||||
let result: GVGCityAreaPointType = await GVGCityAreaPointModel.findOneAndUpdate({ configId, groupKey, pointId }, { $set: { teamCode: '' }}, { new: true }).lean();
|
||||
let result: GVGCityAreaPointType = await GVGCityAreaPointModel.findOneAndUpdate({ configId, groupKey, pointId }, { $set: { teamCode: '', roleId: '', roleName: '', leagueCode: '', leagueName: '' }}, { new: true }).lean();
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user