* fix bug: can not get child dept users.

This commit is contained in:
chenfeiCF
2016-04-27 09:03:23 +08:00
parent b66ce7411a
commit 4126db324d
+2 -1
View File
@@ -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');