<?php namespace App\Controllers;
helper('util');

class OrgManage extends BaseController
{
    /****************************************************
     *       组织部门管理页面
     /****************************************************/
	public function orgManagePage()
	{
        $data = array();
        $username = $this->request->getGet("username");
        $token = $this->request->getGet("token");
        if($username == "" || $token == ""){
          $data["userInfo"] = [];
        }else{
            $signModel = new \App\Models\SignModel();
            $userInfo = $signModel->getItemByUsername($username);
            $orgManageModel = new \App\Models\OrgManageModel();
            $orgSections = $orgManageModel->getAllOrgSection();
          if($userInfo[0]["token"] == $token){
            $data["userInfo"] = $userInfo[0];
            $data["notification"] = [];   
            $data["orgSections"] = $orgSections; 
            //TODO 小红点的逻辑需要加上               
          }else{
            $data["userInfo"] = [];
          }
        }
        $data["uri"] = getUriInfo($this->request);
        return view('orgManage/org_manage',$data);
    }

}