queue->push( new \common\fm\HttpRequestRecord(['equipment'=>2,'ip'=>Yii::$app->request->userIP, 'referer'=> $server->GetReferer(),'self_url'=> $server->GetCurUrl(),'agent'=>$server->getAgentInfo()]) ); $view = Yii::$app->view; $hostName = Yii::$app->request->getHostName(); $num = substr_count($hostName,'.'); switch ($num) { case 1: $view->params['main_city_url'] = $hostName; break; case 2: $hostName = explode('.',$hostName); $view->params['main_city_url'] = $hostName[1].'.'.$hostName[2];; break; } $city = new \common\models\CategoryCity(); $city->pid = 0; $city->state = 1; $view->params['main_city'] = $city->getList([]); //国内 $city->pid = 0; $city->state = 1; $city->del = 1; $city->abroad = 1; $view->params['city_within'] = $city->getList([]); //国外 $city->abroad = 2; $view->params['city_abroad'] = $city->getList([]); $view->params['nav_cityname'] = '全国'; if(Yii::$app->hostserver->hostId != 0) { $view->params['nav_cityname'] = $city->FindById(Yii::$app->hostserver->hostId)['city_name']; } //导航栏 $sysmenu = new \common\models\Frontend(); $sysmenu->pid = 4; $view->params['sysmenu'] = $sysmenu->SonList(7,['name','url','icon','function']); // echo '维护中'; // exit; } // public function beforeAction($action) // { // if(empty(Yii::$app->session['user_info'])){ // echo ""; // return false; // } // // //异地登录 // $model = new \backend\server\Checkauthority(); // $unique = $model->UniqueToken(); // // if($unique == false) // // { // // echo ""; // // return false; // // } // //超级管理员 // if(Yii::$app->session['user_info']['user'] === Yii::$app->params['UserSuperadministrator']) return true; // // // //权限控制 // $controller = strtolower(Yii::$app->controller->id); // $action = strtolower(Yii::$app->controller->action->id); // if($model->Comparison($controller,$action) === true) // { // return true; // } // // if(Yii::$app->request->isAjax) // { // $list['code'] = 500; // $list['msg'] = '暂无操作权限'; // $list['data'] = ''; // echo json_encode($list); // return false; // } //// echo ''; // return false; // } }