public static function get_enabled_tourdata() {
        global $DB;

        $cache = \cache::make('tool_usertours', self::CACHENAME_TOUR);

        $data = $cache->get(self::CACHEKEY_TOUR);
        if ($data === false) {
            $sql = <<<EOF
                SELECT t.*
                  FROM {tool_usertours_tours} t
                 WHERE t.enabled = 1
                   AND t.id IN (SELECT s.tourid FROM {tool_usertours_steps} s GROUP BY s.tourid)
              ORDER BY t.sortorder ASC
EOF;

            $data = $DB->get_records_sql($sql);
            $cache->set('tours', $data);
        }

        return $data;
    }