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){
switch ($value['id_module_type']) {
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';
break;
default:

View File

@ -271,17 +271,38 @@ function grafico_modulo_sparse_data_chart (
);
}
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']
);
if($data_module_graph['id_module_type'] == 2 ||
$data_module_graph['id_module_type'] == 6 ||
$data_module_graph['id_module_type'] == 21 ||
$data_module_graph['id_module_type'] == 18 ||
$data_module_graph['id_module_type'] == 9 ||
$data_module_graph['id_module_type'] == 31 ||
$data_module_graph['id_module_type'] == 100){
$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 ('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']
);
}
}
}