This commit is contained in:
liyuchun
2021-10-18 10:21:08 +08:00
parent e3291b0e2a
commit c8fe1f5e14
2 changed files with 20 additions and 4 deletions
+16
View File
@@ -156,6 +156,22 @@ class groupModel extends model
->fetchAll('id');
}
/**
* Get groups by accounts.
*
* @param array $accounts
* @access public
* @return array
*/
public function getByAccounts($accounts)
{
return $this->dao->select('t1.account, t2.acl, t2.id')->from(TABLE_USERGROUP)->alias('t1')
->leftJoin(TABLE_GROUP)->alias('t2')
->on('t1.`group` = t2.id')
->where('t1.account')->in($accounts)
->fetchGroup('account');
}
/**
* Get the account number in the group.
*