fix product

This commit is contained in:
Ilham Dwi Pratama S 2021-12-22 07:33:07 +07:00
parent d8b9202fb7
commit ee42cc9acd

View File

@ -77,9 +77,9 @@ export class ProductService {
'product.code',
'sub_categories.name',
'category.name',
]);
// .addSelect('current_price.price')
// .addSelect('(current_price.price + current_price.mark_up_price) as mark_up_price');
])
.addSelect('current_price.price')
.addSelect('(current_price.price + current_price.mark_up_price) as mark_up_price');
if (subCategories != 'null' && subCategories) {
baseQuery.andWhere('product.sub_categories_id = :id', {
@ -94,9 +94,9 @@ export class ProductService {
// }
const data = await baseQuery
.skip(page * 10)
.take(10)
.getMany();
.offset(page * 10)
.limit(10)
.getRawMany();
const totalData = await baseQuery.getCount();