fixed order by events reports

This commit is contained in:
daniel 2017-01-02 16:08:02 +01:00
parent b5154b78cb
commit bda0177ad2
2 changed files with 8 additions and 5 deletions

View File

@ -148,7 +148,7 @@ function events_get_events_grouped($sql_post, $offset = 0,
FROM $table te
WHERE 1=1 " . $sql_post . "
GROUP BY estado, evento, id_agentmodule" . $groupby_extra . "
ORDER BY timestamp_rep DESC LIMIT " . $offset . "," . $pagination;
ORDER BY timestamp_rep ASC LIMIT " . $offset . "," . $pagination;
}
break;
case "postgresql":
@ -180,7 +180,7 @@ function events_get_events_grouped($sql_post, $offset = 0,
te.owner_user,
te.ack_utimestamp,
te.custom_data " . $groupby_extra . "
ORDER BY timestamp_rep DESC LIMIT " . $pagination . " OFFSET " . $offset;
ORDER BY timestamp_rep ASC LIMIT " . $pagination . " OFFSET " . $offset;
}
break;
case "oracle":
@ -205,12 +205,12 @@ function events_get_events_grouped($sql_post, $offset = 0,
WHERE 1=1 $sql_post
GROUP BY estado, to_char(evento), id_agentmodule$groupby_extra) tb
ON ta.id_evento = tb.id_evento
ORDER BY tb.timestamp_rep DESC";
ORDER BY tb.timestamp_rep ASC";
$sql = oracle_recode_query ($sql, $set);
}
break;
}
//Extract the events by filter (or not) from db
$events = db_get_all_rows_sql ($sql, $history_db);

View File

@ -6350,7 +6350,10 @@ function reporting_get_agents_detailed_event ($id_agents, $period = 0,
}
if ($only_data) {
foreach ($event as $e) {
$nevents = count($event);
for($i=$nevents-1; $i >= 0; $i--) {
$e = $event[$i];
//foreach ($event as $e) {
$return_data[] = array(
'status' => $e['estado'],
'count' => $e['event_rep'],