寻宝:增加设置情谊助战的接口

This commit is contained in:
liangtongchuan
2021-01-27 16:00:49 +08:00
parent aa41523792
commit 11c5705a5f
3 changed files with 36 additions and 1 deletions
+5
View File
@@ -144,6 +144,11 @@ export default class ComBattleTeam extends BaseModel {
return team;
}
public static async updateRoleStFrd(teamCode: string, roleId: string, isFrd: boolean, lean = true) {
const team: ComBattleTeamType = await ComBattleTeamModel.findOneAndUpdate({ teamCode, 'roleStatus.roleId': roleId }, { $set: {'roleStatus.$.isFrd': isFrd}}, {new: true}).lean(lean);
return team;
}
public static async removeTeam(teamCode: string, lean = true) {
const team: ComBattleTeamType = await ComBattleTeamModel.findOneAndDelete({ teamCode }).lean(lean);
return team;