🐞 fix(武将攻略): 武将对比时将我方全局值也下发
This commit is contained in:
@@ -288,11 +288,10 @@ function calSchoolPoint(quality: number, star: number, colorStar: number) {
|
||||
|
||||
export async function getSchoolPoint(roleId: string) {
|
||||
let schools = await SchoolModel.findByRoleId(roleId);
|
||||
return schools.reduce((pre, cur) => {
|
||||
if(cur.isOpen && cur.hid > 0) {
|
||||
return pre + calSchoolPoint(cur.quality, cur.star, cur.colorStar);
|
||||
}
|
||||
return pre;
|
||||
let hids = schools.filter(cur => cur.isOpen && cur.hid > 0).map(school => school.hid);
|
||||
let heroes = await HeroModel.findByHidRange(hids, roleId);
|
||||
return heroes.reduce((pre, cur) => {
|
||||
return pre + calSchoolPoint(cur.quality, cur.star, cur.colorStar);
|
||||
}, 0);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user