mirror of
https://github.com/knadh/listmonk.git
synced 2024-09-20 07:16:33 +08:00
Fix incorrect count in subscriber query when there are no results.
This commit is contained in:
parent
45f1f80a76
commit
fedc51514d
|
@ -326,7 +326,7 @@ SELECT COUNT(*) AS total FROM subscribers
|
|||
|
||||
-- name: query-subscribers-count-all
|
||||
-- Cached query for getting the "all" subscriber count without arbitrary conditions.
|
||||
SELECT SUM(subscriber_count) AS total FROM mat_list_subscriber_stats
|
||||
SELECT COALESCE(SUM(subscriber_count), 0) AS total FROM mat_list_subscriber_stats
|
||||
WHERE list_id = ANY(CASE WHEN CARDINALITY($1::INT[]) > 0 THEN $1 ELSE '{0}' END)
|
||||
AND ($2 = '' OR status = $2::subscription_status);
|
||||
|
||||
|
|
Loading…
Reference in a new issue