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