summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorunwox <me@unwox.com>2025-03-18 14:07:47 +0600
committerunwox <me@unwox.com>2025-03-18 14:07:47 +0600
commit3229f722f653e174f6d9dabd34ea820c02aafa5d (patch)
treeb7f1d4dfc52f41c1e0c8644dbc826e06a35dfc17 /bin
parent36f040cd16d1d974d611ed9e4b98ba74c8c01b42 (diff)
fix products ordering by creation_time
Diffstat (limited to 'bin')
-rw-r--r--bin/serve.fnl8
1 files 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))