MDL-56516 tool_usertours: Adjust tour query for MySQL

This commit is contained in:
Andrew Nicols 2016-10-25 08:39:36 +08:00
parent 1093e43bda
commit 67b49f27a4

View File

@ -61,10 +61,8 @@ class cache {
$sql = <<<EOF
SELECT t.*
FROM {tool_usertours_tours} t
INNER JOIN {tool_usertours_steps} s ON s.tourid = t.id
WHERE t.enabled = 1
GROUP BY t.id
HAVING COUNT(s.id) > 0
AND t.id IN (SELECT s.tourid FROM {tool_usertours_steps} s GROUP BY s.tourid)
ORDER BY t.sortorder ASC
EOF;