添加获取寻宝记录接口
This commit is contained in:
@@ -94,6 +94,7 @@ export const STATUS = {
|
||||
COM_BATTLE_RM_TEAMMATE_ERR: { code: 20621, simStr: '移除队友失败' },
|
||||
COM_BATTLE_CAN_NOT_RM: { code: 20622, simStr: '没有移除成员的权限' },
|
||||
COM_BATTLE_DISSMISS_ERR: { code: 20623, simStr: '解散队伍异常' },
|
||||
COM_BATTLE_NO_RECENT_REC: { code: 20624, simStr: '没有最近的寻宝记录' },
|
||||
|
||||
// 秘境 20700 - 20799
|
||||
DUNGEON_REFRESH_TIMES_LACK: { code: 20701, simStr: '购买次数不足' },
|
||||
|
||||
@@ -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