* finish task#1203.

* code for task#1323.
This commit is contained in:
chencongzhi520@gmail.com
2013-04-15 02:13:22 +00:00
parent 63ef3df46b
commit 862c73cf1e
6 changed files with 69 additions and 34 deletions
+16
View File
@@ -130,6 +130,22 @@ class groupModel extends model
return $this->dao->findById($groupID)->from(TABLE_GROUP)->fetch();
}
/**
* Get group by account.
*
* @param string $account
* @access public
* @return array
*/
public function getByAccount($account)
{
return $this->dao->select('t2.*')->from(TABLE_USERGROUP)->alias('t1')
->leftJoin(TABLE_GROUP)->alias('t2')
->on('t1.group = t2.id')
->where('t1.account')->eq($account)
->fetchAll('id');
}
/**
* Get privileges of a groups.
*