寻宝:匹配多选

This commit is contained in:
luying
2022-02-25 17:16:17 +08:00
parent 224383b31e
commit 2db328759e
4 changed files with 49 additions and 35 deletions

View File

@@ -289,9 +289,9 @@ export default class ComBattleTeam extends BaseModel {
return team;
}
public static async getOtherTeamByLvAndSt(roleId: string, lv: number, status: number, ce = 0, pub = true, cntLmt = 2, lean = true) {
public static async getOtherTeamByLvAndSt(roleId: string, lvs: number[], status: number, ce = 0, pub = true, cntLmt = 2, lean = true) {
const curTime = new Date(Date.now() - 10 * 60 * 1000); // 10分钟之前
const team: ComBattleTeamType[] = await ComBattleTeamModel.find({ lv, status, ceLimit: {$lte: ce}, pub, roleCnt: {$lte: cntLmt}, roleIds: {$nin: [roleId]}, updatedAt: {$gte: curTime}}).lean(lean);
const team: ComBattleTeamType[] = await ComBattleTeamModel.find({ lv: { $in: lvs }, status, ceLimit: {$lte: ce}, pub, roleCnt: {$lte: cntLmt}, roleIds: {$nin: [roleId]}, updatedAt: {$gte: curTime}}).lean(lean);
return team;
}