From 3229f722f653e174f6d9dabd34ea820c02aafa5d Mon Sep 17 00:00:00 2001 From: unwox Date: Tue, 18 Mar 2025 14:07:47 +0600 Subject: fix products ordering by creation_time --- bin/serve.fnl | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bin/serve.fnl b/bin/serve.fnl index b05eaa5..799d3ac 100644 --- a/bin/serve.fnl +++ b/bin/serve.fnl @@ -315,9 +315,11 @@ %s GROUP BY products.url ORDER BY %s - ROW_NUMBER() over (PARTITION BY products.site ORDER BY products.ROWID), - rank, - permanent_products.creation_time DESC + ROW_NUMBER() OVER + (PARTITION BY products.site + ORDER BY permanent_products.creation_time DESC, + products.title ASC), + rank LIMIT 24 OFFSET ?" where-sql sort-sql) (array.concat query-args [(* (- page 1) 24)]))) :total (if (< 0 (# total)) -- cgit v1.2.3