= NOW() - INTERVAL 30 MINUTE", "#__analytics_visitors.device != 'bot'" ]; $bind = [ 'visit', 'action' ]; parent::aesirx_analytics_add_filters($params, $where_clause, $bind); $total_sql = "SELECT " . implode(", ", $total_select) . " FROM #__analytics_events LEFT JOIN #__analytics_visitors ON #__analytics_visitors.uuid = #__analytics_events.visitor_uuid LEFT JOIN #__analytics_flows ON #__analytics_flows.uuid = #__analytics_events.flow_uuid WHERE " . implode(" AND ", $where_clause); $sql = "SELECT " . implode(", ", $select) . " FROM #__analytics_events LEFT JOIN #__analytics_visitors ON #__analytics_visitors.uuid = #__analytics_events.visitor_uuid LEFT JOIN #__analytics_flows ON #__analytics_flows.uuid = #__analytics_events.flow_uuid WHERE " . implode(" AND ", $where_clause); if (!empty($groups)) { $sql .= " GROUP BY " . implode(", ", $groups); } $allowed = [ "number_of_visitors", "number_of_page_views", "number_of_unique_page_views", "average_session_duration", "average_number_of_pages_per_session", "bounce_rate", ]; $default = reset($allowed); foreach ($groups as $one_group) { $allowed[] = $one_group; $default = $one_group; } foreach ($groups as $additional_result) { $allowed[] = $additional_result; } $sort = parent::aesirx_analytics_add_sort($params, $allowed, $default); if (!empty($sort)) { $sql .= " ORDER BY " . implode(", ", $sort); } return parent::aesirx_analytics_get_list($sql, $total_sql, $params, $allowed, $bind); } }