fix(index) perbaikan index item - item rates

pull/33/head
Aswin Ashar Abdullah 2024-07-19 17:47:09 +07:00
parent 1560cb0512
commit cc92ef26a1
2 changed files with 6 additions and 0 deletions

View File

@ -72,6 +72,7 @@ export class IndexItemRateManager extends BaseIndexManager<ItemEntity> {
get selects(): string[] {
return [
`${this.tableName}.id`,
`${this.tableName}.status`,
`${this.tableName}.created_at`,
`${this.tableName}.name`,
`${this.tableName}.base_price`,
@ -126,6 +127,9 @@ export class IndexItemRateManager extends BaseIndexManager<ItemEntity> {
});
}
queryBuilder.andWhere(`${this.tableName}.status In (:...statuses)`, {
statuses: [STATUS.ACTIVE],
});
return queryBuilder;
}
}

View File

@ -85,6 +85,8 @@ export class IndexItemManager extends BaseIndexManager<ItemEntity> {
queryBuilder.andWhere(`${this.tableName}.tenant_id In (:...tenantIds)`, {
tenantIds: this.filterParam.tenant_ids,
});
} else if (!this.filterParam.all_item) {
queryBuilder.andWhere(`${this.tableName}.tenant_id Is Null`);
}
return queryBuilder;