add: order by in product retail

This commit is contained in:
ilham 2022-03-11 00:25:06 +07:00
parent 9f0536e2d1
commit 876842eb53

View File

@ -263,9 +263,8 @@ export class ProductService {
) )
.select(['product.id']) .select(['product.id'])
.addSelect(['product.name', 'product.code', 'sub_categories.name']) .addSelect(['product.name', 'product.code', 'sub_categories.name'])
.addSelect( .addSelect('(current_price.price + current_price.mark_up_price) as price')
'(current_price.price + current_price.mark_up_price) as price', .orderBy('price', 'ASC');
);
if (subCategories != 'null' && subCategories) { if (subCategories != 'null' && subCategories) {
baseQuery.andWhere('product.sub_categories_id = :id', { baseQuery.andWhere('product.sub_categories_id = :id', {