summaryrefslogtreecommitdiff
path: root/bin/serve.fnl
diff options
context:
space:
mode:
Diffstat (limited to 'bin/serve.fnl')
-rw-r--r--bin/serve.fnl8
1 files changed, 5 insertions, 3 deletions
diff --git a/bin/serve.fnl b/bin/serve.fnl
index 8793537..b05eaa5 100644
--- a/bin/serve.fnl
+++ b/bin/serve.fnl
@@ -210,9 +210,9 @@
(fn latest-update-date []
(. (must (luna.db.query db
- "SELECT creation_time
+ "SELECT update_time
FROM products
- ORDER BY creation_TIME DESC
+ ORDER BY update_time DESC
LIMIT 1" []))
1 1))
@@ -309,13 +309,15 @@
FROM search
INNER JOIN products ON search.fid = products.url
LEFT JOIN product_tags ON product_tags.product = products.url
+ LEFT JOIN permanent_products ON permanent_products.url = products.url
WHERE search.`table` = 'products'
AND products.archived = false
%s
GROUP BY products.url
ORDER BY %s
ROW_NUMBER() over (PARTITION BY products.site ORDER BY products.ROWID),
- rank
+ rank,
+ permanent_products.creation_time DESC
LIMIT 24 OFFSET ?" where-sql sort-sql)
(array.concat query-args [(* (- page 1) 24)])))
:total (if (< 0 (# total))