Fix: bug filter get product by categories

This commit is contained in:
mfadiln2018 2022-05-24 22:33:14 +07:00
parent 1050ca4c85
commit 9e177679a8

View File

@ -344,6 +344,7 @@ export class ProductService {
'product.name', 'product.name',
'product.code', 'product.code',
'product.type', 'product.type',
'product.status',
'sub_categories.name', 'sub_categories.name',
'current_price.admin_price as admin_price', 'current_price.admin_price as admin_price',
'current_price.mark_up_price as markup_price', 'current_price.mark_up_price as markup_price',
@ -368,7 +369,9 @@ export class ProductService {
if (subCategories && filterSubCategories.length > 0) { if (subCategories && filterSubCategories.length > 0) {
baseQuery.where('product.sub_categories_id IN (:...subCategoryId)', { baseQuery.where('product.sub_categories_id IN (:...subCategoryId)', {
subCategoryId: filterSubCategories, subCategoryId: filterSubCategories,
}); }).where(`product.status = 'ACTIVE'`)
;
} }
const newData = [] const newData = []