pvp排行榜展示

This commit is contained in:
mamengke01
2021-01-11 17:10:20 +08:00
parent b5ed1e3a4b
commit d94ba65847
4 changed files with 27 additions and 7 deletions
+2 -1
View File
@@ -242,7 +242,7 @@ export async function defaultHeroes ( role:RoleType, challengeCnt?:number, chall
let { heroes } = await PvpDefenseModel.findByRoleId(role.roleId);
var orders = [1, 2, 3, 4, 5];
heroes.sort(function(a, b) {
if (!!a.order) {
if (!!a.order&& !!a.hero) {
let index = orders.indexOf(a.order);
orders.splice(index, 1);
}
@@ -278,6 +278,7 @@ export async function defaultHeroes ( role:RoleType, challengeCnt?:number, chall
}
} else {
heroes[index].ce = item.ce;
heroes[index].hero = item.hero;
if (!heroes[index].order) {
heroes[index].order = orders[0];
orders.splice(0, 1);