✨ feat(好友): 展示阵容优化
This commit is contained in:
@@ -100,6 +100,7 @@ export class EPlace {
|
||||
|
||||
@index({ seqId: 1 })
|
||||
@index({ roleId: 1, hid: 1 })
|
||||
@index({ roleId: 1, ce: -1 })
|
||||
export default class Hero extends BaseModel {
|
||||
|
||||
@prop({ required: true })
|
||||
@@ -182,6 +183,11 @@ export default class Hero extends BaseModel {
|
||||
return heros;
|
||||
}
|
||||
|
||||
public static async findAndSortByCe(roleId: string) {
|
||||
const heroes: HeroType[] = await HeroModel.find({ roleId }).sort({ ce: -1 }).lean();
|
||||
return heroes
|
||||
}
|
||||
|
||||
public static async findBySeqIdRange(seqIds: Array<number>, roleId: string, lean = true) {
|
||||
const hero: HeroType[] = await HeroModel.find({ seqId: { $in: seqIds }, roleId }).lean(lean);
|
||||
return hero;
|
||||
|
||||
Reference in New Issue
Block a user