summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunwox <me@unwox.com>2024-11-21 15:04:49 +0600
committerunwox <me@unwox.com>2024-11-21 15:04:49 +0600
commit9c446e241e067eb7d3846d811773d1a358abcd13 (patch)
treef4a153069a11c74e6532e4d5438bbf3c71063652
parent05351c539603d699394a2f523634ab373162ec12 (diff)
do not count archived products in statistics
-rw-r--r--bin/serve.fnl10
1 files 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 []