🐞 fix(gvg): 修复gvg激战期bug
This commit is contained in:
@@ -82,6 +82,12 @@ export default class GVGBattleRec extends BaseModel {
|
||||
@prop({ required: true, type: TeamInfo, _id: false })
|
||||
defenseTeam: TeamInfo; // 防守队伍
|
||||
|
||||
@prop({ required: true, type: TeamInfo, _id: false })
|
||||
attackTeamAfter: TeamInfo; // 挑战队伍
|
||||
|
||||
@prop({ required: true, type: TeamInfo, _id: false })
|
||||
defenseTeamAfter: TeamInfo; // 防守队伍
|
||||
|
||||
@prop({ required: true })
|
||||
isSuccess: boolean;
|
||||
|
||||
@@ -99,8 +105,8 @@ export default class GVGBattleRec extends BaseModel {
|
||||
return result;
|
||||
}
|
||||
|
||||
public static async battleEnd(battleCode: string, isSuccess: boolean) {
|
||||
const result: GVGBattleRecType = await GVGBattleRecModel.findOneAndUpdate({ battleCode }, { $set: { isSuccess, battleEndTime: nowSeconds() } }, { new: true }).lean();
|
||||
public static async battleEnd(battleCode: string, isSuccess: boolean, attackTeam: GVGTeamType, defenseTeam: GVGTeamType) {
|
||||
const result: GVGBattleRecType = await GVGBattleRecModel.findOneAndUpdate({ battleCode }, { $set: { isSuccess, battleEndTime: nowSeconds(), attackTeamAfter: attackTeam, defenseTeamAfter: defenseTeam } }, { new: true }).lean();
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user