feat: Filter top tags to only include those assigned to at least one item.
This commit is contained in:
@@ -14,6 +14,7 @@ export default (router, tpl) => {
|
|||||||
LEFT JOIN tags_assign ta ON t.id = ta.tag_id
|
LEFT JOIN tags_assign ta ON t.id = ta.tag_id
|
||||||
WHERE t.id not in (${db.unsafe(nsfp)})
|
WHERE t.id not in (${db.unsafe(nsfp)})
|
||||||
GROUP BY t.id, t.tag
|
GROUP BY t.id, t.tag
|
||||||
|
HAVING COUNT(DISTINCT ta.item_id) >= 1
|
||||||
ORDER BY total_items DESC
|
ORDER BY total_items DESC
|
||||||
;
|
;
|
||||||
`;
|
`;
|
||||||
@@ -23,6 +24,7 @@ export default (router, tpl) => {
|
|||||||
FROM tags t
|
FROM tags t
|
||||||
LEFT JOIN tags_assign ta ON t.id = ta.tag_id
|
LEFT JOIN tags_assign ta ON t.id = ta.tag_id
|
||||||
GROUP BY t.id, t.tag
|
GROUP BY t.id, t.tag
|
||||||
|
HAVING COUNT(DISTINCT ta.item_id) >= 1
|
||||||
ORDER BY total_items DESC
|
ORDER BY total_items DESC
|
||||||
;
|
;
|
||||||
`;
|
`;
|
||||||
|
|||||||
Reference in New Issue
Block a user