From 894eb03bad803248928eb294b4de13656d5a8f66 Mon Sep 17 00:00:00 2001 From: Peter Rotich <peter@osticket.com> Date: Thu, 9 Aug 2012 11:36:52 -0400 Subject: [PATCH] Fix staff and departments count --- include/staff/groups.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/staff/groups.inc.php b/include/staff/groups.inc.php index ccb16257b..2e994710b 100644 --- a/include/staff/groups.inc.php +++ b/include/staff/groups.inc.php @@ -3,7 +3,7 @@ if(!defined('OSTADMININC') || !$thisstaff || !$thisstaff->isAdmin()) die('Access $qstr=''; -$sql='SELECT grp.*,count(staff.staff_id) as users, count(dept.dept_id) as depts ' +$sql='SELECT grp.*,count(DISTINCT staff.staff_id) as users, count(DISTINCT dept.dept_id) as depts ' .' FROM '.GROUP_TABLE.' grp ' .' LEFT JOIN '.STAFF_TABLE.' staff ON(staff.group_id=grp.group_id) ' .' LEFT JOIN '.GROUP_DEPT_TABLE.' dept ON(dept.group_id=grp.group_id) ' -- GitLab