Merge remote-tracking branch 'origin/develop' into 2075-Proteccion_en_cascada_de_servicios

This commit is contained in:
daniel 2018-06-25 15:46:36 +02:00
commit 7dc60b65a2
2 changed files with 33 additions and 12 deletions

View File

@ -3093,7 +3093,7 @@ function series_type_graph_array($data, $show_elements_graph){
elseif(strpos($key, 'sum') !== false || strpos($key, 'baseline') !== false){ elseif(strpos($key, 'sum') !== false || strpos($key, 'baseline') !== false){
switch ($value['id_module_type']) { switch ($value['id_module_type']) {
case 21: case 2: case 6: case 21: case 2: case 6:
case 18: case 9: case 31: case 18: case 9: case 31: case 100:
$data_return['series_type'][$key] = 'boolean'; $data_return['series_type'][$key] = 'boolean';
break; break;
default: default:

View File

@ -271,17 +271,38 @@ function grafico_modulo_sparse_data_chart (
); );
} }
else{ else{
$data = db_get_all_rows_filter ( if($data_module_graph['id_module_type'] == 2 ||
'tagente_datos', $data_module_graph['id_module_type'] == 6 ||
array ('id_agente_modulo' => (int)$agent_module_id, $data_module_graph['id_module_type'] == 21 ||
"utimestamp > '". $date_array['start_date']. "'", $data_module_graph['id_module_type'] == 18 ||
"utimestamp < '". $date_array['final_date'] . "'", $data_module_graph['id_module_type'] == 9 ||
'group' => "ROUND(utimestamp / $data_slice)", $data_module_graph['id_module_type'] == 31 ||
'order' => 'utimestamp ASC'), $data_module_graph['id_module_type'] == 100){
array ('sum(datos)/count(datos) as datos', 'min(utimestamp) as utimestamp'), $data = db_get_all_rows_filter (
'AND', 'tagente_datos',
$data_module_graph['history_db'] array ('id_agente_modulo' => (int)$agent_module_id,
); "utimestamp > '". $date_array['start_date']. "'",
"utimestamp < '". $date_array['final_date'] . "'",
'group' => "ROUND(utimestamp / $data_slice)",
'order' => 'utimestamp ASC'),
array ('ROUND(sum(datos)/count(datos)) as datos', 'min(utimestamp) as utimestamp'),
'AND',
$data_module_graph['history_db']
);
}
else{
$data = db_get_all_rows_filter (
'tagente_datos',
array ('id_agente_modulo' => (int)$agent_module_id,
"utimestamp > '". $date_array['start_date']. "'",
"utimestamp < '". $date_array['final_date'] . "'",
'group' => "ROUND(utimestamp / $data_slice)",
'order' => 'utimestamp ASC'),
array ('sum(datos)/count(datos) as datos', 'min(utimestamp) as utimestamp'),
'AND',
$data_module_graph['history_db']
);
}
} }
} }