Last active
October 5, 2018 14:39
-
-
Save heathdutton/bab518e0ab46485d9b9eb1af66731697 to your computer and use it in GitHub Desktop.
Find unpublished categories in Mautic that have published campaigns under them. Because these categories are unpublished all campaigns under them will be paused.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT cat.id as category_id, cat.title as category_name, COUNT(camp.id) as campaigns | |
FROM campaigns camp | |
LEFT JOIN categories cat | |
ON camp.category_id = cat.id | |
WHERE | |
cat.is_published = 0 | |
AND camp.is_published = 1 | |
GROUP BY cat.id; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment