Created
October 11, 2017 09:20
-
-
Save pgk/e2c75ddaf8755422aa9bc2e928d90dc5 to your computer and use it in GitHub Desktop.
Sensei: Show specific course/lesson status report for a learner
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
-- Sensei: Show specific course/lesson status report for a learner | |
-- | |
-- Substitute table names and user id to match your setup | |
SELECT u.ID, COUNT(c.comment_type) AS `cnt`, c.comment_type AS `status_type`, c.comment_approved AS `status` | |
FROM `wp_users` AS u | |
JOIN `wp_comments` AS c ON u.ID = c.user_id | |
WHERE | |
c.comment_type IN ('sensei_course_status', 'sensei_lesson_status') AND | |
u.ID = 1 | |
GROUP BY u.ID, c.comment_type, c.comment_approved; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment