|
发表于 2012-10-16 09:42:51
|
显示全部楼层
PHP复制代码
//遍历groups
$data = array();
$groups = $this->db->get('用户组')->result_array();
foreach ($groups as $group) {
//获取组权限
$groupPre = $this->db->select('permissionid')->where(array('groupid' => $value['groupid']))->get('用户组权限关系')->result_array();
$data[$value['name']] = array();
foreach($groupPre as $pre)
$data[$value['name']][] = $this->db->select('name')->get_where('权限',array('permissionid' => $pre->permissionid))->first_row->name;
}
复制代码 |
|