From a16e87cbd05b407b7a49a860a6991c667df2f7ad Mon Sep 17 00:00:00 2001 From: Chaitanya Date: Mon, 13 Nov 2023 14:48:23 +0530 Subject: [PATCH] Fix: Exclude flagged proposals from active proposals count (#750) --- src/helpers/spaces.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/helpers/spaces.ts b/src/helpers/spaces.ts index bafb9625..3b475127 100644 --- a/src/helpers/spaces.ts +++ b/src/helpers/spaces.ts @@ -113,7 +113,7 @@ async function getProposals() { const ts = parseInt((Date.now() / 1e3).toFixed()); const query = ` SELECT space, COUNT(id) AS count, - COUNT(IF(start < ? AND end > ?, 1, NULL)) AS active, + COUNT(IF(start < ? AND end > ? AND flagged = 0, 1, NULL)) AS active, count(IF(created > (UNIX_TIMESTAMP() - 604800), 1, NULL)) as count_7d FROM proposals GROUP BY space `;