军团:限制重名

This commit is contained in:
luying
2021-09-10 17:43:43 +08:00
parent cec130b7c4
commit ed1e5d1635
2 changed files with 9 additions and 2 deletions

View File

@@ -116,8 +116,8 @@ export default class Guild extends BaseModel {
}
public static async checkName(name: string, serverId: number) {
const result: GuildType = await GuildModel.findOne({ name, status: GUILD_STATUS.RUNNING, serverId }).lean();
return !!result;
const result = await GuildModel.exists({ name, status: GUILD_STATUS.RUNNING, serverId });
return result;
}
public static async findByCondition(page: number, showPeopleMax: boolean, name: string, serverId: number) {