mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-29 08:45:12 +02:00
Merge branch '385-api_reports_no_data' into 'pandora_6.0'
Fixed api get module data. Ticket #385 See merge request !213
This commit is contained in:
commit
a2c4d4a2e0
@ -5914,10 +5914,18 @@ function api_get_module_data($id, $thrash1, $other, $returnType) {
|
|||||||
ORDER BY utimestamp DESC", $id, $date_start, $date_end);
|
ORDER BY utimestamp DESC", $id, $date_start, $date_end);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$sql = sprintf ("SELECT utimestamp, datos
|
if ($periodSeconds == null) {
|
||||||
FROM tagente_datos
|
$sql = sprintf ("SELECT utimestamp, datos
|
||||||
WHERE id_agente_modulo = %d AND utimestamp > %d
|
FROM tagente_datos
|
||||||
ORDER BY utimestamp DESC", $id, get_system_time () - $periodSeconds);
|
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';
|
$data['type'] = 'array';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user