fix bug 远征显示下一关等

This commit is contained in:
luying
2020-11-17 17:37:05 +08:00
parent 0e2f043f93
commit 80b8f1bac7
13 changed files with 73 additions and 49 deletions
+5
View File
@@ -7,6 +7,7 @@ import { updateCe } from '../pubUtils/util';
* 英雄表
*/
@index({ roleId: 1, hid: 1 })
@index({ roleId: 1, seqId: 1 })
export default class Hero extends BaseModel {
@prop({ required: true })
@@ -60,6 +61,10 @@ export default class Hero extends BaseModel {
return heros || [];
}
public static async findBySeqIdRange(seqIds: Array<number>, roleId: string, lean = true) {
const hero = await HeroModel.find({ seqId: {$in: seqIds}, roleId }).lean(lean);
return hero;
}
public static async findBySeqIdAndRole(seqId: number, roleId: string, lean = true) {
const hero = await HeroModel.findOne({ seqId, roleId }).lean(lean);
return hero;