getCategoryCounters: properly handle categories which don't have any stored feeds/articles
This commit is contained in:
parent
076c5382fa
commit
47135160d1
|
@ -29,10 +29,10 @@ class Counters {
|
||||||
SUM(CASE WHEN marked THEN 1 ELSE 0 END) AS count_marked,
|
SUM(CASE WHEN marked THEN 1 ELSE 0 END) AS count_marked,
|
||||||
(SELECT COUNT(id) FROM ttrss_feed_categories fcc
|
(SELECT COUNT(id) FROM ttrss_feed_categories fcc
|
||||||
WHERE fcc.parent_cat = fc.id) AS num_children
|
WHERE fcc.parent_cat = fc.id) AS num_children
|
||||||
FROM ttrss_feed_categories fc, ttrss_feeds f, ttrss_user_entries ue
|
FROM ttrss_feed_categories fc
|
||||||
WHERE f.cat_id = fc.id AND
|
LEFT JOIN ttrss_feeds f ON (f.cat_id = fc.id)
|
||||||
ue.feed_id = f.id AND
|
LEFT JOIN ttrss_user_entries ue ON (ue.feed_id = f.id)
|
||||||
ue.owner_uid = :uid
|
WHERE fc.owner_uid = :uid
|
||||||
GROUP BY fc.id
|
GROUP BY fc.id
|
||||||
UNION
|
UNION
|
||||||
SELECT 0,
|
SELECT 0,
|
||||||
|
|
Loading…
Reference in New Issue