changed duplicated code with id_souce_event field

This commit is contained in:
marcos.alconada 2019-06-21 12:37:32 +02:00
parent effbf5094f
commit 31ec8933a2
1 changed files with 7 additions and 14 deletions

View File

@ -1309,9 +1309,6 @@ function events_get_events_grouped(
$groupby_extra = ''; $groupby_extra = '';
} }
db_process_sql('SET group_concat_max_len = 9999999');
$event_lj = events_get_secondary_groups_left_join($table);
if ($total) {
if (is_metaconsole()) { if (is_metaconsole()) {
$id_source_event = get_parameter('id_source_event'); $id_source_event = get_parameter('id_source_event');
if ($id_source_event != '') { if ($id_source_event != '') {
@ -1319,18 +1316,14 @@ function events_get_events_grouped(
} }
} }
db_process_sql('SET group_concat_max_len = 9999999');
$event_lj = events_get_secondary_groups_left_join($table);
if ($total) {
$sql = "SELECT COUNT(*) FROM (SELECT id_evento $sql = "SELECT COUNT(*) FROM (SELECT id_evento
FROM $table te $event_lj FROM $table te $event_lj
WHERE 1=1 ".$sql_post.' WHERE 1=1 ".$sql_post.'
GROUP BY estado, evento, id_agente, id_agentmodule'.$groupby_extra.') AS t'; GROUP BY estado, evento, id_agente, id_agentmodule'.$groupby_extra.') AS t';
} else { } else {
if (is_metaconsole()) {
$id_source_event = get_parameter('id_source_event');
if ($id_source_event != '') {
$sql_post .= "AND id_source_event = $id_source_event";
}
}
$sql = "SELECT *, MAX(id_evento) AS id_evento, $sql = "SELECT *, MAX(id_evento) AS id_evento,
GROUP_CONCAT(DISTINCT user_comment SEPARATOR '<br>') AS user_comment, GROUP_CONCAT(DISTINCT user_comment SEPARATOR '<br>') AS user_comment,
GROUP_CONCAT(DISTINCT id_evento SEPARATOR ',') AS similar_ids, GROUP_CONCAT(DISTINCT id_evento SEPARATOR ',') AS similar_ids,