名将擂台:检查排名添加分服
This commit is contained in:
@@ -4,6 +4,7 @@ import { LadderDefense, LadderOppPlayerInDB } from '../domain/battleField/ladder
|
||||
import Role from './Role';
|
||||
|
||||
@index({ roleId: 1 })
|
||||
@index({ serverId: 1, rank: 1 })
|
||||
export default class LadderMatch extends BaseModel {
|
||||
@prop({ required: true, default: 0 })
|
||||
serverId: number; // 角色 id
|
||||
@@ -41,13 +42,13 @@ export default class LadderMatch extends BaseModel {
|
||||
return result;
|
||||
}
|
||||
|
||||
public static async findByRank(rank: number) {
|
||||
const result: LadderMatchType = await LadderMatchModel.findOne({ rank }).lean();
|
||||
public static async findByRank(serverId: number, rank: number) {
|
||||
const result: LadderMatchType = await LadderMatchModel.findOne({ serverId, rank }).lean();
|
||||
return result;
|
||||
}
|
||||
|
||||
public static async isRankExist(rank: number) {
|
||||
const result = await LadderMatchModel.exists({ rank });
|
||||
public static async isRankExist(serverId: number, rank: number) {
|
||||
const result = await LadderMatchModel.exists({ serverId, rank });
|
||||
return result;
|
||||
}
|
||||
public static async findByRoleIdAndInclude(roleId: string) {
|
||||
|
||||
Reference in New Issue
Block a user