mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-16 22:55:03 +00:00
parent
ce4b65cd35
commit
83d6bc86ce
1 changed files with 10 additions and 0 deletions
|
@ -24,6 +24,7 @@ export class GuildCases extends BaseGuildRepository {
|
||||||
return this.cases.find({
|
return this.cases.find({
|
||||||
relations: this.getRelations(),
|
relations: this.getRelations(),
|
||||||
where: {
|
where: {
|
||||||
|
guild_id: this.guildId,
|
||||||
id: In(ids),
|
id: In(ids),
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
@ -33,6 +34,7 @@ export class GuildCases extends BaseGuildRepository {
|
||||||
return this.cases.findOne({
|
return this.cases.findOne({
|
||||||
relations: this.getRelations(),
|
relations: this.getRelations(),
|
||||||
where: {
|
where: {
|
||||||
|
guild_id: this.guildId,
|
||||||
id,
|
id,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
@ -42,6 +44,7 @@ export class GuildCases extends BaseGuildRepository {
|
||||||
return this.cases.findOne({
|
return this.cases.findOne({
|
||||||
relations: this.getRelations(),
|
relations: this.getRelations(),
|
||||||
where: {
|
where: {
|
||||||
|
guild_id: this.guildId,
|
||||||
case_number: caseNumber,
|
case_number: caseNumber,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
@ -51,6 +54,7 @@ export class GuildCases extends BaseGuildRepository {
|
||||||
return this.cases.findOne({
|
return this.cases.findOne({
|
||||||
relations: this.getRelations(),
|
relations: this.getRelations(),
|
||||||
where: {
|
where: {
|
||||||
|
guild_id: this.guildId,
|
||||||
mod_id: modId,
|
mod_id: modId,
|
||||||
},
|
},
|
||||||
order: {
|
order: {
|
||||||
|
@ -63,6 +67,7 @@ export class GuildCases extends BaseGuildRepository {
|
||||||
return this.cases.findOne({
|
return this.cases.findOne({
|
||||||
relations: this.getRelations(),
|
relations: this.getRelations(),
|
||||||
where: {
|
where: {
|
||||||
|
guild_id: this.guildId,
|
||||||
audit_log_id: auditLogId,
|
audit_log_id: auditLogId,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
@ -72,6 +77,7 @@ export class GuildCases extends BaseGuildRepository {
|
||||||
return this.cases.find({
|
return this.cases.find({
|
||||||
relations: this.getRelations(),
|
relations: this.getRelations(),
|
||||||
where: {
|
where: {
|
||||||
|
guild_id: this.guildId,
|
||||||
user_id: userId,
|
user_id: userId,
|
||||||
},
|
},
|
||||||
order: {
|
order: {
|
||||||
|
@ -84,6 +90,7 @@ export class GuildCases extends BaseGuildRepository {
|
||||||
return this.cases.find({
|
return this.cases.find({
|
||||||
relations: this.getRelations(),
|
relations: this.getRelations(),
|
||||||
where: {
|
where: {
|
||||||
|
guild_id: this.guildId,
|
||||||
user_id: userId,
|
user_id: userId,
|
||||||
},
|
},
|
||||||
skip,
|
skip,
|
||||||
|
@ -97,6 +104,7 @@ export class GuildCases extends BaseGuildRepository {
|
||||||
async getTotalCasesByModId(modId: string): Promise<number> {
|
async getTotalCasesByModId(modId: string): Promise<number> {
|
||||||
return this.cases.count({
|
return this.cases.count({
|
||||||
where: {
|
where: {
|
||||||
|
guild_id: this.guildId,
|
||||||
mod_id: modId,
|
mod_id: modId,
|
||||||
is_hidden: false,
|
is_hidden: false,
|
||||||
},
|
},
|
||||||
|
@ -107,6 +115,7 @@ export class GuildCases extends BaseGuildRepository {
|
||||||
return this.cases.find({
|
return this.cases.find({
|
||||||
relations: this.getRelations(),
|
relations: this.getRelations(),
|
||||||
where: {
|
where: {
|
||||||
|
guild_id: this.guildId,
|
||||||
mod_id: modId,
|
mod_id: modId,
|
||||||
is_hidden: false,
|
is_hidden: false,
|
||||||
},
|
},
|
||||||
|
@ -152,6 +161,7 @@ export class GuildCases extends BaseGuildRepository {
|
||||||
const lastCaseNumberRow = await this.cases
|
const lastCaseNumberRow = await this.cases
|
||||||
.createQueryBuilder()
|
.createQueryBuilder()
|
||||||
.select(["MAX(case_number) AS last_case_number"])
|
.select(["MAX(case_number) AS last_case_number"])
|
||||||
|
.where("guild_id = :guildId", { guildId: this.guildId })
|
||||||
.getRawOne();
|
.getRawOne();
|
||||||
const lastCaseNumber = lastCaseNumberRow?.last_case_number || 0;
|
const lastCaseNumber = lastCaseNumberRow?.last_case_number || 0;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue