Example #1
0
 public function delete()
 {
     $id = request('id');
     if (UsergroupModel::delete($id)) {
         $this->success('/admin/usergroup');
     } else {
         $this->error();
     }
 }
Example #2
0
 public function init()
 {
     $userInfo = $this->isLogin();
     if (!$userInfo) {
         $this->error('没有登陆');
     } else {
         $userInfo['department'] = DepartmentModel::get($userInfo['department_id']);
         $userInfo['group'] = UsergroupModel::get($userInfo['group_id']);
         $this->userInfo = $userInfo;
     }
     if (!$this->checkPermission()) {
         $this->error('没有权限');
     }
     $this->_menuList();
 }
Example #3
0
 public function __construct()
 {
     $groupList = UsergroupModel::getList();
     $tmp = array();
     if ($groupList) {
         foreach ($groupList as $group) {
             $tmp[$group['id']] = $group;
         }
     }
     $groupList = $tmp;
     $departmentList = DepartmentModel::getList();
     $tmp = array();
     $this->mkTree($departmentList, $tmp);
     $this->assign('groupList', $groupList);
     $this->assign('departmentList', $tmp);
     parent::__construct();
 }