添加获取寻宝记录接口
This commit is contained in:
@@ -137,12 +137,15 @@ export default class ComBattleTeam extends BaseModel {
|
||||
return teams;
|
||||
}
|
||||
|
||||
public static async getTeamByRoleAndTime(roleId: string, quality: number, time: Date, lean = true) {
|
||||
let query = {roleIds: roleId, createdAt: {$gte: time}};
|
||||
public static async getTeamByRoleAndTime(roleId: string, quality?: number, time?: Date, limitCnt = 50, lean = true) {
|
||||
let query = {roleIds: roleId};
|
||||
if (quality) {
|
||||
query = Object.assign(query, {quality});
|
||||
}
|
||||
const teams = await ComBattleTeamModel.find(query).lean(lean);
|
||||
if (time) {
|
||||
query = Object.assign(query, {createdAt: {$gte: time}});
|
||||
}
|
||||
const teams = await ComBattleTeamModel.find(query).limit(limitCnt).lean(lean);
|
||||
return teams;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user