获取进入助战次数

This commit is contained in:
liangtongchuan
2020-11-24 21:07:42 +08:00
parent 7cf30b7ddb
commit e3325cda39
2 changed files with 17 additions and 1 deletions
+5 -1
View File
@@ -138,7 +138,11 @@ export default class ComBattleTeam extends BaseModel {
}
public static async getTeamByRoleAndTime(roleId: string, quality: number, time: Date, lean = true) {
const teams = await ComBattleTeamModel.find({roleIds: roleId, quality, createdAt: {$gte: time}}).lean(lean);
let query = {roleIds: roleId, createdAt: {$gte: time}};
if (quality) {
query = Object.assign(query, {quality});
}
const teams = await ComBattleTeamModel.find(query).lean(lean);
return teams;
}
}