寻宝战斗结束判断;寻宝战斗结束保存信息

This commit is contained in:
liangtongchuan
2020-11-29 00:52:57 +08:00
parent 60dd9a1013
commit 1ce535669b
3 changed files with 141 additions and 11 deletions

View File

@@ -97,6 +97,7 @@ export const STATUS = {
COM_BATTLE_DISSMISS_ERR: { code: 20623, simStr: '解散队伍异常' },
COM_BATTLE_NO_RECENT_REC: { code: 20624, simStr: '没有最近的寻宝记录' },
COM_BATTLE_HURT_NUM_ERR: { code: 20625, simStr: '血量计算错误' },
COM_BATTLE_START_ERR: { code: 20626, simStr: '开始战斗失败' },
// 共斗藏宝图合成
COM_BLUEPRT_QUALITY_CANNOT_COMPOSE: { code: 20630, simStr: '该品质藏宝图不可合成' },

View File

@@ -121,6 +121,16 @@ export default class ComBattleTeam extends BaseModel {
return team;
}
public static async syncTeamData(teamData: {teamCode: string, status: number, roleStatus: Array<RoleStatus>}, lean = true) {
const team = await ComBattleTeamModel.findOneAndUpdate({ teamCode: teamData.teamCode }, {$set :{...teamData}}, {new: true}).lean(lean);
return team;
}
public static async updateStatus(teamCode: string, status: number, lean = true) {
const team = await ComBattleTeamModel.findOneAndUpdate({ teamCode: teamCode }, {status}, {new: true}).lean(lean);
return team;
}
public static async updateResult(teamCode: string, roleId: string, isSuccess: boolean, _lean = true) {
let team = await ComBattleTeamModel.findOne({teamCode}).select('status roleStatus');
if(!team) return;