fix(SPG-559) Item rate - index - search masih belum bisa (masih menampilkan semua data)
parent
c35f966b5a
commit
bc296cc52a
|
@ -90,12 +90,36 @@ export class IndexItemRateManager extends BaseIndexManager<ItemEntity> {
|
|||
}
|
||||
|
||||
get specificFilter(): Param[] {
|
||||
return [];
|
||||
return [
|
||||
{
|
||||
cols: `${ this.tableName }.name`,
|
||||
data: this.filterParam.names,
|
||||
},
|
||||
{
|
||||
cols: `${ this.tableName }.item_type::text`,
|
||||
data: this.filterParam.item_types,
|
||||
},
|
||||
{
|
||||
cols: `${ this.tableName }.limit_type::text`,
|
||||
data: this.filterParam.limit_types,
|
||||
},
|
||||
{
|
||||
cols: `item_category.name`,
|
||||
data: this.filterParam.item_categories,
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
setQueryFilter(
|
||||
queryBuilder: SelectQueryBuilder<ItemEntity>,
|
||||
): SelectQueryBuilder<ItemEntity> {
|
||||
if (this.filterParam.tenant_ids?.length) {
|
||||
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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue