寻宝战斗结束判断;寻宝战斗结束保存信息
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user