mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-04-08 18:55:09 +02:00
Fixed api get module data. Ticket #385
This commit is contained in:
parent
e074b021f3
commit
938dc40f77
@ -6282,10 +6282,18 @@ function api_get_module_data($id, $thrash1, $other, $returnType) {
|
||||
ORDER BY utimestamp DESC", $id, $date_start, $date_end);
|
||||
}
|
||||
else {
|
||||
$sql = sprintf ("SELECT utimestamp, datos
|
||||
FROM tagente_datos
|
||||
WHERE id_agente_modulo = %d AND utimestamp > %d
|
||||
ORDER BY utimestamp DESC", $id, get_system_time () - $periodSeconds);
|
||||
if ($periodSeconds == null) {
|
||||
$sql = sprintf ("SELECT utimestamp, datos
|
||||
FROM tagente_datos
|
||||
WHERE id_agente_modulo = %d
|
||||
ORDER BY utimestamp DESC", $id);
|
||||
}
|
||||
else {
|
||||
$sql = sprintf ("SELECT utimestamp, datos
|
||||
FROM tagente_datos
|
||||
WHERE id_agente_modulo = %d AND utimestamp > %d
|
||||
ORDER BY utimestamp DESC", $id, get_system_time () - $periodSeconds);
|
||||
}
|
||||
}
|
||||
|
||||
$data['type'] = 'array';
|
||||
|
Loading…
x
Reference in New Issue
Block a user