* put getDeptUserPairs method from group model to dept model.

This commit is contained in:
chenfeiCF
2016-03-13 08:02:35 +08:00
parent bf33b5f108
commit 6b055c87fe
3 changed files with 17 additions and 17 deletions
+16
View File
@@ -333,6 +333,22 @@ class deptModel extends model
->page($pager)
->fetchAll();
}
/**
* Get user pairs of a department.
*
* @param int $deptID
* @access public
* @return array
*/
public function getDeptUserPairs($deptID = 0)
{
return $this->dao->select('account, realname')->from(TABLE_USER)
->where('deleted')->eq(0)
->beginIF($deptID)->andWhere('dept')->eq((int)$deptID)->fi()
->orderBy('account')
->fetchPairs();
}
/**
* Delete a department.