/**
  * 编辑用户
  */
 public function actionEdit()
 {
     $uid = $uid = $this->helpGparam('uid');
     $userinfo = Users::getById($uid);
     //加载所有角色
     $roleList = Roles::getByUsergroupId($this->user_group_id);
     $user_role_ids = User_Role_Relate::getByUid($uid);
     //加载所有功能
     $funcList = Func::getByParentId(0);
     $funcData = array();
     foreach ($funcList as $k => $func) {
         $data = array('id' => $func['id'], 'name' => $func['caption'], 'isParent' => true, 'open' => true);
         $childList = Func::getByParentId($func['id']);
         $data['children'] = array();
         foreach ($childList as $cf) {
             $data['children'][] = array('id' => $cf['id'], 'name' => $cf['caption'], 'pId' => $func['id'], 'isParent' => false);
         }
         $funcData[] = $data;
     }
     $data = ['userinfo' => $userinfo, 'funcData' => $funcData, 'uid' => $uid, 'roleList' => $roleList, 'user_role_ids' => $user_role_ids];
     return $this->render('edit', $data);
 }
 public function actionIndex()
 {
     $roleList = Roles::getByUsergroupId($this->user_group_id);
     return $this->render('index', array('roleList' => $roleList));
 }