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

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
+1
View File
@@ -106,6 +106,7 @@ export const STATUS = {
COM_BATTLE_REWARD_ERR: { code: 20627, simStr: '不能领取奖励' },
COM_BATTLE_REWARDED: { code: 20628, simStr: '奖励已领取' },
COM_BATTLE_HEROES_ERR: { code: 20629, simStr: '阵容异常' },
COM_BATTLE_SET_FRD_ERR: { code: 20630, simStr: '设置情谊助战异常' },
// 共斗藏宝图合成
COM_BLUEPRT_QUALITY_CANNOT_COMPOSE: { code: 20630, simStr: '该品质藏宝图不可合成' },
+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;