fix web-server tsc不通过
This commit is contained in:
@@ -84,8 +84,9 @@ export default class ComBattleTeam extends BaseModel {
|
|||||||
return team;
|
return team;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static async updateResult(teamCode: string, roleId: string, isSuccess: boolean, lean = true) {
|
public static async updateResult(teamCode: string, roleId: string, isSuccess: boolean, _lean = true) {
|
||||||
let team = await ComBattleTeamModel.findOne({teamCode}).select('status roleStatus');
|
let team = await ComBattleTeamModel.findOne({teamCode}).select('status roleStatus');
|
||||||
|
if(!team) return;
|
||||||
if (isSuccess === true) {
|
if (isSuccess === true) {
|
||||||
team.status = 2;
|
team.status = 2;
|
||||||
team.roleStatus.forEach(st => {
|
team.roleStatus.forEach(st => {
|
||||||
|
|||||||
+1
-1
@@ -387,7 +387,7 @@ export default class Role extends BaseModel {
|
|||||||
public static async saveDungeonHero(roleId: string, battleId: number, heroes: Array<number>, isSuccess: boolean) {
|
public static async saveDungeonHero(roleId: string, battleId: number, heroes: Array<number>, isSuccess: boolean) {
|
||||||
if(isSuccess) {
|
if(isSuccess) {
|
||||||
const role = await Role.findByRoleId(roleId);
|
const role = await Role.findByRoleId(roleId);
|
||||||
let {dungeonHeroes} = role;
|
let dungeonHeroes = role && role.dungeonHeroes;
|
||||||
let hasHero = dungeonHeroes&&dungeonHeroes.find(cur => cur.battleId == battleId);
|
let hasHero = dungeonHeroes&&dungeonHeroes.find(cur => cur.battleId == battleId);
|
||||||
if(!dungeonHeroes || !hasHero) {
|
if(!dungeonHeroes || !hasHero) {
|
||||||
await RoleModel.findOneAndUpdate({roleId}, {$push:{dungeonHeroes: {battleId, heroes}}})
|
await RoleModel.findOneAndUpdate({roleId}, {$push:{dungeonHeroes: {battleId, heroes}}})
|
||||||
|
|||||||
Reference in New Issue
Block a user