diff options
Diffstat (limited to 'bin')
| -rw-r--r-- | bin/serve.fnl | 8 |
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)) |
