From 4126db324d24a4ea787747e77db3071822a57091 Mon Sep 17 00:00:00 2001 From: chenfeiCF Date: Wed, 27 Apr 2016 09:03:23 +0800 Subject: [PATCH] * fix bug: can not get child dept users. --- module/dept/model.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/module/dept/model.php b/module/dept/model.php index a287862fee..8e220fd2e2 100644 --- a/module/dept/model.php +++ b/module/dept/model.php @@ -363,9 +363,10 @@ class deptModel extends model if(strpos($params, 'devfirst')!== false) $fields .= ", INSTR(',td,pm,qd,qa,dev,', role) AS roleOrder"; $orderBy = strpos($params, 'first') !== false ? 'roleOrder DESC, account' : 'account'; + $childDeptIds = $this->getAllChildID($deptID); $users = $this->dao->select($fields)->from(TABLE_USER) ->where('deleted')->eq(0) - ->beginIF($deptID)->andWhere('dept')->eq((int)$deptID)->fi() + ->beginIF($deptID)->andWhere('dept')->in($childDeptIds)->fi() ->orderBy($orderBy) ->fetchAll('account');