changed duplicated code with id_souce_event field
This commit is contained in:
parent
effbf5094f
commit
31ec8933a2
|
@ -1309,28 +1309,21 @@ function events_get_events_grouped(
|
||||||
$groupby_extra = '';
|
$groupby_extra = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (is_metaconsole()) {
|
||||||
|
$id_source_event = get_parameter('id_source_event');
|
||||||
|
if ($id_source_event != '') {
|
||||||
|
$sql_post .= "AND id_source_event = $id_source_event";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
db_process_sql('SET group_concat_max_len = 9999999');
|
db_process_sql('SET group_concat_max_len = 9999999');
|
||||||
$event_lj = events_get_secondary_groups_left_join($table);
|
$event_lj = events_get_secondary_groups_left_join($table);
|
||||||
if ($total) {
|
if ($total) {
|
||||||
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 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,
|
||||||
|
|
Loading…
Reference in New Issue