group by id_agent in group events

This commit is contained in:
Daniel Maya 2017-09-28 16:46:40 +02:00
parent e18a3bbe36
commit 7a061edb66
1 changed files with 2 additions and 2 deletions

View File

@ -146,7 +146,7 @@ function events_get_events_grouped($sql_post, $offset = 0,
$sql = "SELECT COUNT(*) FROM (SELECT *
FROM $table te
WHERE 1=1 " . $sql_post . "
GROUP BY estado, evento, id_agentmodule" . $groupby_extra . ") AS t";
GROUP BY estado, evento, id_agente, id_agentmodule" . $groupby_extra . ") AS t";
}
else {
$sql = "SELECT *, MAX(id_evento) AS id_evento,
@ -161,7 +161,7 @@ function events_get_events_grouped($sql_post, $offset = 0,
(SELECT ack_utimestamp FROM $table WHERE id_evento = MAX(te.id_evento)) AS ack_utimestamp
FROM $table te
WHERE 1=1 " . $sql_post . "
GROUP BY estado, evento, id_agentmodule" . $groupby_extra . "
GROUP BY estado, evento, id_agente, id_agentmodule" . $groupby_extra . "
ORDER BY timestamp_rep " . $order . " LIMIT " . $offset . "," . $pagination;
}
break;