This commit is contained in:
ditiqi 2025-01-27 22:43:20 +08:00
parent 4499e0e38d
commit a47401971e
1 changed files with 14 additions and 14 deletions

View File

@ -17,20 +17,22 @@ export class TermRowService extends RowCacheService {
createUnGroupingRowSelect(
requset: z.infer<typeof TermMethodSchema.getRows>,
): string[] {
const result = super.createUnGroupingRowSelect(requset).concat([
const result = super
.createUnGroupingRowSelect(requset)
.concat([
`${this.tableName}.name AS name`,
`${this.tableName}.order AS order`,
`${this.tableName}.has_children AS has_children`,
`${this.tableName}.parent_id AS parent_id`,
`${this.tableName}.domain_id AS domain_id`,
`taxonomy.name AS taxonomy_name`,
`taxonomy.id AS taxonomy_id`
`taxonomy.id AS taxonomy_id`,
]);
return result;
}
createJoinSql(request?: RowModelRequest): string[] {
return [
`LEFT JOIN taxonomy ON ${this.tableName}.taxonomy_id = taxonomy.id`
`LEFT JOIN taxonomy ON ${this.tableName}.taxonomy_id = taxonomy.id`,
];
}
protected createGetRowsFilters(
@ -53,7 +55,7 @@ export class TermRowService extends RowCacheService {
} else if (parentId === null) {
condition.AND.push({
field: `${this.tableName}.parent_id`,
op: "blank",
op: 'blank',
});
}
}
@ -66,7 +68,7 @@ export class TermRowService extends RowCacheService {
} else if (domainId === null) {
condition.AND.push({
field: `${this.tableName}.domain_id`,
op: "blank",
op: 'blank',
});
}
if (taxonomyId) {
@ -84,8 +86,6 @@ export class TermRowService extends RowCacheService {
});
}
return condition;
}
}