feat(寻宝): 队长奖励加成限制上限

This commit is contained in:
luying
2022-12-26 17:20:32 +08:00
parent 49c095979d
commit cd5fd0c074
5 changed files with 32 additions and 5 deletions
+7
View File
@@ -377,6 +377,13 @@ export default class ComBattleTeam extends BaseModel {
return teams;
}
public static async getCapExtraRewardCnt(roleId: string, time: Date) {
const teams: ComBattleTeamType[] = await ComBattleTeamModel.find({
capId: roleId, createdAt: { $gte: time }, status: {$in: [0, 1, 2]}, hasTimeExtraReward: true
}).lean();
return teams;
}
public static async getTeamByRoleAndBattleCode(roleId: string, battleCode: string, lean = true) {
const team: ComBattleTeamType = await ComBattleTeamModel.findOne({roleIds: roleId, 'roleStatus.battleCode': battleCode}).lean(lean);
return team;