isAjax()){ $this->error('未登录,请先登录'); }else{ $url = request()->domain().'/common/login.html'; $this->redirect($url); } } $this->userId = is_login(); $this->orgId = cur_org_id(); $user = session('user_auth'); $this->rolesId = !empty($user)&&isset($user['rolesId'])?$user['rolesId']:0; $this->assign('rolesId',$this->rolesId); // 检查是否有紧急事件 $info = Db::name('burst_record') ->where('user_id',$this->userId) ->where('status',1) ->where('del',0) ->find(); if($info){ $this->redirect(url('Bursting/index')); } parent::initialize(); } public function getTableField($table,$where,$field){ $val = Db::name($table) ->where($where) ->value($field); return $val; } }