From 104988e60d92e1c9f5b5fe39fd8b1d4de8b79ff0 Mon Sep 17 00:00:00 2001 From: swaggboi Date: Sun, 30 Jun 2024 01:27:48 -0400 Subject: [PATCH] This works just kinda hate it oh well --- lib/PostText/Model/Thread.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/PostText/Model/Thread.pm b/lib/PostText/Model/Thread.pm index f380650..756c1d1 100644 --- a/lib/PostText/Model/Thread.pm +++ b/lib/PostText/Model/Thread.pm @@ -38,7 +38,11 @@ sub by_page($self, $this_page = 1) { t.thread_author AS author, t.thread_title AS title, t.thread_body AS body, - COUNT(r.*) AS remark_tally, + SUM(CASE + WHEN NOT r.hidden_status + THEN 1 + ELSE 0 + END) AS remark_tally, t.bump_tally AS bump_tally FROM threads AS t LEFT JOIN remarks AS r