fix 远征相应获取属性逻辑

This commit is contained in:
luying
2021-01-09 16:30:59 +08:00
parent be77ffab3f
commit e516458fbb
4 changed files with 74 additions and 42 deletions

View File

@@ -154,7 +154,10 @@ export default class PvpDefense extends BaseModel {
}
public static async findByScale(roleId: string, min: number, max: number, lean = true) {
const result: PvpDefenseType[] = await PvpDefenseModel.find({ roleId: { $ne: roleId }, defCe: { $lte: max, $gte: min } }).sort({ updatedAt: -1 }).limit(100).lean(lean);
const result: PvpDefenseType[] = await PvpDefenseModel.find({ roleId: { $ne: roleId }, defCe: { $lte: max, $gte: min } })
.populate('role', 'headHid sHid topFiveCe roleId roleName')
.populate('heroes.hero')
.sort({ updatedAt: -1 }).limit(100).lean(lean);
return result;
}