fixed propagation in agents count

This commit is contained in:
alejandro.campos@artica.es 2021-11-11 11:07:24 +01:00
parent 9c290d917e
commit 1fe0523a6a
1 changed files with 13 additions and 0 deletions

View File

@ -105,6 +105,19 @@ function tactical_get_data($id_user=false, $user_strict=false, $acltags, $return
if (is_metaconsole() && !empty($list_groups)) {
$cache_table = 'tmetaconsole_agent';
if (users_is_admin() === false) {
$user_groups_ids_array = explode(',', $user_groups_ids);
$user_group_children_ids = [];
foreach ($user_groups_ids_array as $user_group_id) {
$group_children_ids = groups_get_children_ids($user_group_id);
$user_group_children_ids = array_merge($user_group_children_ids, $group_children_ids);
}
$user_groups_ids = implode(',', array_unique($user_group_children_ids));
}
$sql_stats = "SELECT id_grupo, COUNT(id_agente) AS agents_total,
SUM(total_count) AS monitors_total,
SUM(normal_count) AS monitors_ok,