[Secondary groups] Avoid duplicates in manage agents
This commit is contained in:
parent
168d081268
commit
b597c936e8
|
@ -361,7 +361,7 @@ if ($ag_group > 0) {
|
||||||
$user_groups_to_sql = implode (',', array_keys ($user_groups));
|
$user_groups_to_sql = implode (',', array_keys ($user_groups));
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = sprintf ('SELECT COUNT(*)
|
$sql = sprintf ('SELECT COUNT(DISTINCT(tagente.id_agente))
|
||||||
FROM tagente LEFT JOIN tagent_secondary_group tasg
|
FROM tagente LEFT JOIN tagent_secondary_group tasg
|
||||||
ON tagente.id_agente = tasg.id_agent
|
ON tagente.id_agente = tasg.id_agent
|
||||||
WHERE (tagente.id_grupo IN (%s) OR tasg.id_group IN (%s))
|
WHERE (tagente.id_grupo IN (%s) OR tasg.id_group IN (%s))
|
||||||
|
@ -376,6 +376,7 @@ $sql = sprintf ('SELECT *
|
||||||
ON tagente.id_agente = tasg.id_agent
|
ON tagente.id_agente = tasg.id_agent
|
||||||
WHERE (tagente.id_grupo IN (%s) OR tasg.id_group IN (%s))
|
WHERE (tagente.id_grupo IN (%s) OR tasg.id_group IN (%s))
|
||||||
%s
|
%s
|
||||||
|
GROUP BY tagente.id_agente
|
||||||
ORDER BY %s %s, %s %s
|
ORDER BY %s %s, %s %s
|
||||||
LIMIT %d, %d',
|
LIMIT %d, %d',
|
||||||
$user_groups_to_sql, $user_groups_to_sql,
|
$user_groups_to_sql, $user_groups_to_sql,
|
||||||
|
|
Loading…
Reference in New Issue