From 3661d9d1717fe6f2b2a41602468a2d06d4513dc5 Mon Sep 17 00:00:00 2001 From: shancheas Date: Mon, 9 Jun 2025 17:26:57 +0700 Subject: [PATCH] feat: increase item limit to 1000 and enhance query for time group filtering --- .../booking-online/order/infrastructure/item.controller.ts | 1 + .../item/domain/usecases/managers/index-item.manager.ts | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/modules/booking-online/order/infrastructure/item.controller.ts b/src/modules/booking-online/order/infrastructure/item.controller.ts index a3bf89c..061edcf 100644 --- a/src/modules/booking-online/order/infrastructure/item.controller.ts +++ b/src/modules/booking-online/order/infrastructure/item.controller.ts @@ -21,6 +21,7 @@ export class ItemController { async index( @Query() params: FilterItemDto, ): Promise> { + params.limit = 1000; params.show_to_booking = true; this.indexManager.setFilterParam(params); this.indexManager.setService(this.serviceData, TABLE_NAME.ITEM); diff --git a/src/modules/item-related/item/domain/usecases/managers/index-item.manager.ts b/src/modules/item-related/item/domain/usecases/managers/index-item.manager.ts index 28ef6f9..02204ed 100644 --- a/src/modules/item-related/item/domain/usecases/managers/index-item.manager.ts +++ b/src/modules/item-related/item/domain/usecases/managers/index-item.manager.ts @@ -53,6 +53,7 @@ export class IndexItemManager extends BaseIndexManager { `${this.tableName}.share_profit`, `${this.tableName}.breakdown_bundling`, `${this.tableName}.play_estimation`, + `${this.tableName}.show_to_booking`, `item_category.id`, `item_category.name`, @@ -108,7 +109,7 @@ export class IndexItemManager extends BaseIndexManager { if (this.filterParam.time_group_ids?.length) { queryBuilder.andWhere( - `${this.tableName}.time_group_id In (:...timeGroupIds)`, + `${this.tableName}.time_group_id In (:...timeGroupIds) OR ${this.tableName}.time_group_id Is Null`, { timeGroupIds: this.filterParam.time_group_ids, },