'record_status' => CommonConstant::STATUS_NORMAL, ]); $query->andWhere('NOW() >= COALESCE(active_date, \'0001-01-01 00:00:00\')'); $query->andWhere('NOW() <= COALESCE(expire_date, \'9999-12-31 23:59:59\')'); $model = $query->addOrderBy('active_date DESC')->one(); if ($model != null) { $model->pageRecVersionLang = $model->pageRecVersionLangs[0]; } } return $model; } public static function getModelByRoute($route, $alias) { $query = self::find()->with([
$query->andWhere('NOW() >= COALESCE(active_date, \'0001-01-01 00:00:00\')'); $query->andWhere('NOW() <= COALESCE(expire_date, \'9999-12-31 23:59:59\')'); $model = $query->addOrderBy('active_date DESC')->one(); if ($model != null) { $model->pageRecVersionLang = $model->pageRecVersionLangs[0]; } } return $model; }
$this->tracking = true; $this->trackingUrl = Yii::$app->params['trackingUrl']; } if ($this->pageRecModel != null) { // $this->pageModel = PageRecVersion::getModelById($this->pageRecModel->page_rec_id, $this->languageId); $this->pageModel = PageRecVersion::getModelById($this->pageRecModel->page_rec_id); $this->breadcrumbs = PageRec::getBreadcrumbs($this->pageRecModel->page_rec_id); $this->isReviewDate = strtotime($this->pageModel->review_date) > strtotime($this->pageModel->revision_date); $this->updateDate = strtotime($this->pageModel->review_date) > strtotime($this->pageModel->revision_date) ? Common::formatDate($this->pageModel->review_date) : Common::formatDate($this->pageModel->revision_date); $this->setMetaInfo($this->pageModel->pageRecVersionLang->meta_title, $this->pageModel->pageRecVersionLang->meta_keyword, $this->pageModel->pageRecVersionLang->meta_description);
break; } } $result = null; if ($runAction && $this->beforeAction($action)) { // run the action $result = $action->runWithParams($params); $result = $this->afterAction($action, $result); // call afterAction on modules
$parts = $this->createController($route); if (is_array($parts)) { /* @var $controller Controller */ list($controller, $actionID) = $parts; $oldController = Yii::$app->controller; Yii::$app->controller = $controller; $result = $controller->runAction($actionID, $params); if ($oldController !== null) { Yii::$app->controller = $oldController; } return $result; }
$params = $this->catchAll; unset($params[0]); } try { Yii::debug("Route requested: '$route'", __METHOD__); $this->requestedRoute = $route; $result = $this->runAction($route, $params); if ($result instanceof Response) { return $result; } $response = $this->getResponse(); if ($result !== null) {
{ try { $this->state = self::STATE_BEFORE_REQUEST; $this->trigger(self::EVENT_BEFORE_REQUEST); $this->state = self::STATE_HANDLING_REQUEST; $response = $this->handleRequest($this->getRequest()); $this->state = self::STATE_AFTER_REQUEST; $this->trigger(self::EVENT_AFTER_REQUEST); $this->state = self::STATE_SENDING_RESPONSE; $response->send();
defined('YII_ENV') or define('YII_ENV', 'prod'); defined('YII_LANG') or define('YII_LANG', 'en'); require(__DIR__ . '/../common/require.php'); $application = new yii\web\Application($config); $application->run();
$_GET = [ 'alias' => 'careers-post', ];