寻宝解散队伍
This commit is contained in:
@@ -90,8 +90,9 @@ export const STATUS = {
|
||||
COM_BATTLE_ASSIST_NOT_ENOUGH: { code: 20618, simStr: '助战次数不足' },
|
||||
COM_BATTLE_ASSIST_LV_NOT_ENOUGH: { code: 20619, simStr: '助阵等级不够' },
|
||||
COM_BATTLE_RM_SELF: { code: 20620, simStr: '队长移除自己会解散队伍' },
|
||||
COM_BATTLE_RM_TEAMMATE_ERR: { code: 20620, simStr: '移除队友失败' },
|
||||
COM_BATTLE_CAN_NOT_RM: { code: 20620, simStr: '没有移除成员的权限' },
|
||||
COM_BATTLE_RM_TEAMMATE_ERR: { code: 20621, simStr: '移除队友失败' },
|
||||
COM_BATTLE_CAN_NOT_RM: { code: 20622, simStr: '没有移除成员的权限' },
|
||||
COM_BATTLE_DISSMISS_ERR: { code: 20623, simStr: '解散队伍异常' },
|
||||
|
||||
// 秘境 20700 - 20799
|
||||
DUNGEON_REFRESH_TIMES_LACK: { code: 20701, simStr: '购买次数不足' },
|
||||
|
||||
@@ -75,12 +75,17 @@ export default class ComBattleTeam extends BaseModel {
|
||||
}
|
||||
|
||||
public static async addRole(teamCode: string, roleStatus: RoleStatus, lean = true) {
|
||||
const team = await ComBattleTeamModel.findOneAndUpdate({ teamCode: teamCode }, {$push: {roleIds: roleStatus.roleId, roleStatus}}, {upsert: true, new: true}).lean(lean);
|
||||
const team = await ComBattleTeamModel.findOneAndUpdate({ teamCode }, {$push: {roleIds: roleStatus.roleId, roleStatus}}, {upsert: true, new: true}).lean(lean);
|
||||
return team;
|
||||
}
|
||||
|
||||
public static async removeRole(teamCode: string, roleIdToRm: string, lean = true) {
|
||||
const team = await ComBattleTeamModel.findOneAndUpdate({ teamCode: teamCode }, {$pull: {roleIds: roleIdToRm, roleStatus: {roleId: roleIdToRm}}}, {new: true}).lean(lean);
|
||||
const team = await ComBattleTeamModel.findOneAndUpdate({ teamCode }, {$pull: {roleIds: roleIdToRm, roleStatus: {roleId: roleIdToRm}}}, {new: true}).lean(lean);
|
||||
return team;
|
||||
}
|
||||
|
||||
public static async removeTeam(teamCode: string, lean = true) {
|
||||
const team = await ComBattleTeamModel.findOneAndDelete({ teamCode }).lean(lean);
|
||||
return team;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user