Browse Source

Change shop producs sort method, out of stock products alwasy at the end

Vova Tkach 5 years ago
parent
commit
389c277af6
1 changed files with 2 additions and 0 deletions
  1. 2 0
      engine/fetdata/shop.go

+ 2 - 0
engine/fetdata/shop.go

@@ -147,6 +147,7 @@ func (this *Shop) load() *Shop {
 			shop_products.active = 1 AND
 			shop_products.parent_id IS NULL
 		ORDER BY
+			shop_products.quantity DESC,
 			shop_products.id DESC
 		LIMIT ?, ?;
 	`
@@ -303,6 +304,7 @@ func (this *Shop) load() *Shop {
 				shop_products.id,
 				cats.parent_id
 			ORDER BY
+				shop_products.quantity DESC,
 				shop_products.id DESC
 			LIMIT ?, ?;
 		`