From 9c446e241e067eb7d3846d811773d1a358abcd13 Mon Sep 17 00:00:00 2001 From: unwox Date: Thu, 21 Nov 2024 15:04:49 +0600 Subject: do not count archived products in statistics --- bin/serve.fnl | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/bin/serve.fnl b/bin/serve.fnl index 669c3e0..c7bc334 100644 --- a/bin/serve.fnl +++ b/bin/serve.fnl @@ -176,10 +176,16 @@ [])))) (fn shops-count [] - (# (must (luna.db.query db "SELECT DISTINCT site FROM products" [])))) + (# (must (luna.db.query db + "SELECT DISTINCT site + FROM products + WHERE archived = false" [])))) (fn products-count [] - (. (must (luna.db.query db "SELECT DISTINCT COUNT(url) FROM products" [])) + (. (must (luna.db.query db + "SELECT DISTINCT COUNT(url) + FROM products + WHERE archived = false" [])) 1 1)) (fn latest-update-date [] -- cgit v1.2.3