Error Info: Array ( [0] => 42S22 [1] => 1054 [2] => Unknown column 'u.TOTAL_RANKING' in 'field list' )
in /home/html/php72-project/yuanxiao_bailitop_com/vendor/yiisoft/yii2/db/Command.php at line 1302
$exceptionClass = '\yii\db\Exception'; foreach ($this->exceptionMap as $error => $class) { if (strpos($e->getMessage(), $error) !== false) { $exceptionClass = $class; } } $message = $e->getMessage() . "\nThe SQL being executed was: $rawSql"; $errorInfo = $e instanceof \PDOException ? $e->errorInfo : null; return new $exceptionClass($message, $errorInfo, $e->getCode(), $e); } /** * Returns a value indicating whether a SQL statement is for read purpose. * @param string $sql the SQL statement * @return bool whether a SQL statement is for read purpose. */ public function isReadQuery($sql) {
} else { $this->pdoStatement->execute(); } break; } catch (\Exception $e) { $rawSql = $rawSql ?: $this->getRawSql(); $e = $this->db->getSchema()->convertException($e, $rawSql); if ($this->_retryHandler === null || !call_user_func($this->_retryHandler, $e, $attempt)) { throw $e; } } } }
$this->prepare(true); try { $profile and Yii::beginProfile($rawSql, 'yii\db\Command::query'); $this->internalExecute($rawSql); if ($method === '') { $result = new DataReader($this); } else { if ($fetchMode === null) { $fetchMode = $this->fetchMode;
* @return array all rows of the query result. Each array element is an array representing a row of data. * An empty array is returned if the query results in nothing. * @throws Exception execution failed */ public function queryAll($fetchMode = null) { return $this->queryInternal('fetchAll', $fetchMode); } /** * Executes the SQL statement and returns the first row of the result. * This method is best used when only the first row of result is needed for a query. * @param int $fetchMode the result fetch mode. Please refer to [PHP manual](https://www.php.net/manual/en/pdostatement.setfetchmode.php)
$double_info = Yii::$app->pfdb->createCommand("SELECT abp.C_A_P_ID as id, acsp.SCHOOL_PROJECT_NAME as title, acsp.degreetype, acsp.fullname, abp.schoollen, acsp.PROFESSION_RANKING as usnewsranking,u.TOTAL_RANKING as university_total_ranking from COUNTRY_ABROAD_PROJECT as abp LEFT JOIN ABROAD_COLLEGE_SCHOOL_PROJECT as acsp ON abp.PK_A_C_S_P_ID = acsp.A_C_S_P_ID LEFT JOIN university as u ON acsp.PK_UNIVERSITY_ID = u.UNIVERSITY_ID WHERE acsp.PK_UNIVERSITY_ID in ( SELECT UNIVERSITY_ID from university WHERE URLCODE = '" . $getnews['ename'] . "' ) and acsp.PK_MAJORID in ( SELECT PK_MAJOR from major_union WHERE URLCODE = '" . $getnews['major_urlcode'] . "' ) ORDER BY abp.C_A_P_ID desc LIMIT " . ($nums - 1) . " ")->queryAll(); $single_info = Yii::$app->pfdb->createCommand("SELECT abp.C_A_P_ID as id, acsp.SCHOOL_PROJECT_NAME as title, acsp.degreetype, acsp.fullname, abp.schoollen, acsp.PROFESSION_RANKING as usnewsranking,u.TOTAL_RANKING as university_total_ranking from COUNTRY_ABROAD_PROJECT as abp LEFT JOIN ABROAD_COLLEGE_SCHOOL_PROJECT as acsp ON abp.PK_A_C_S_P_ID = acsp.A_C_S_P_ID LEFT JOIN university as u ON acsp.PK_UNIVERSITY_ID = u.UNIVERSITY_ID WHERE acsp.PK_UNIVERSITY_ID in ( SELECT UNIVERSITY_ID from university WHERE URLCODE = '" . $getnews['ename'] . "' ) and acsp.PK_MAJORID in ( SELECT PK_MAJOR from major_union WHERE URLCODE = '" . $getnews['major_urlcode'] . "' ) ORDER BY abp.C_A_P_ID ASC ")->queryOne(); } if(!empty($double_info[0]['usnewsranking'])){ //专业相关项目 $major_datas = Yii::$app->pfdb->createCommand("SELECT abp.C_A_P_ID as id, acsp.SCHOOL_PROJECT_NAME as title, acsp.degreetype, acsp.fullname, abp.schoollen, acsp.PROFESSION_RANKING as usnewsranking,u.TOTAL_RANKING as university_total_ranking from COUNTRY_ABROAD_PROJECT as abp LEFT JOIN ABROAD_COLLEGE_SCHOOL_PROJECT as acsp ON abp.PK_A_C_S_P_ID = acsp.A_C_S_P_ID WHERE acsp.PK_COUNTRY_ID in ( SELECT PK_COUNTRY from university WHERE URLCODE = '" . $getnews['ename'] . "' ) and acsp.PK_MAJORID in ( SELECT PK_MAJOR from major_union WHERE URLCODE = '" . $getnews['major_urlcode'] . "' ) AND abp.C_A_P_ID not in ('.$ids.') AND acsp.PROFESSION_RANKING between ".($double_info[0]['usnewsranking'] -10)." and ".($double_info[0]['usnewsranking']+10)." ORDER BY acsp.PROFESSION_RANKING desc LIMIT 10")->queryAll(); }else{ $major_datas = Yii::$app->pfdb->createCommand("SELECT abp.C_A_P_ID AS id, acsp.SCHOOL_PROJECT_NAME AS title, acsp.degreetype, acsp.fullname, abp.schoollen, acsp.PROFESSION_RANKING AS usnewsranking, u.TOTAL_RANKING as university_total_ranking, u.CN_NAME FROM COUNTRY_ABROAD_PROJECT AS abp LEFT JOIN ABROAD_COLLEGE_SCHOOL_PROJECT AS acsp ON abp.PK_A_C_S_P_ID = acsp.A_C_S_P_ID LEFT JOIN university as u ON acsp.PK_UNIVERSITY_ID = u.UNIVERSITY_ID WHERE acsp.PK_COUNTRY_ID IN ( SELECT PK_COUNTRY FROM university WHERE URLCODE = '" . $getnews['ename'] . "' ) AND acsp.PK_MAJORID IN ( SELECT PK_MAJOR FROM major_union WHERE URLCODE = '" . $getnews['major_urlcode'] . "' ) AND u.TOTAL_RANKING between ".($double_info[0]['university_total_ranking'] -10)." and ".($double_info[0]['university_total_ranking'] + 10)." ORDER BY acsp.PROFESSION_RANKING ASC limit 10")->queryAll(); } //申请该大学相关项目 $univ_datas = Yii::$app->pfdb->createCommand("SELECT abp.C_A_P_ID as id, acsp.SCHOOL_PROJECT_NAME as title, acsp.degreetype, acsp.fullname, abp.schoollen, acsp.PROFESSION_RANKING as usnewsranking from COUNTRY_ABROAD_PROJECT as abp LEFT JOIN ABROAD_COLLEGE_SCHOOL_PROJECT as acsp ON abp.PK_A_C_S_P_ID = acsp.A_C_S_P_ID WHERE acsp.PK_UNIVERSITY_ID in ( SELECT UNIVERSITY_ID from university WHERE URLCODE = '" . $getnews['ename'] . "' ) and acsp.PK_MAJORCATEID in ( SELECT major.PARENT_ID from major_union LEFT JOIN major ON major_union.PK_MAJOR = major.MAJOR_ID WHERE URLCODE = '" . $getnews['major_urlcode'] . "' ) AND abp.C_A_P_ID not in ('.$ids.') and acsp.PROFESSION_RANKING is not null and acsp.PROFESSION_RANKING !='' and acsp.PROFESSION_RANKING!=0 ORDER BY acsp.PROFESSION_RANKING asc LIMIT 10")->queryAll();
{ $_obInitialLevel_ = ob_get_level(); ob_start(); ob_implicit_flush(false); extract($_params_, EXTR_OVERWRITE); try { require $_file_; return ob_get_clean(); } catch (\Exception $e) { while (ob_get_level() > $_obInitialLevel_) { if (!@ob_end_clean()) { ob_clean(); }
$this->renderers[$ext] = Yii::createObject($this->renderers[$ext]); } /* @var $renderer ViewRenderer */ $renderer = $this->renderers[$ext]; $output = $renderer->render($this, $viewFile, $params); } else { $output = $this->renderPhpFile($viewFile, $params); } $this->afterRender($viewFile, $params, $output); } array_pop($this->_viewFiles); $this->context = $oldContext;
* @throws InvalidCallException if the view cannot be resolved. * @see renderFile() */ public function render($view, $params = [], $context = null) { $viewFile = $this->findViewFile($view, $context); return $this->renderFile($viewFile, $params, $context); } /** * Finds the view file based on the given view name. * @param string $view the view name or the [path alias](guide:concept-aliases) of the view file. Please refer to [[render()]] * on how to specify this parameter.
* These parameters will not be available in the layout. * @return string the rendering result. * @throws InvalidArgumentException if the view file or the layout file does not exist. */ public function render($view, $params = []) { $content = $this->getView()->render($view, $params, $this); return $this->renderContent($content); } /** * Renders a static string by applying a layout. * @param string $content the static string being rendered
use yii\web\NotFoundHttpException; class MajorlistAction extends \yii\base\Action { public function run() { return $this->controller->render('majorlists',[ ]); } }
$args = $this->controller->bindActionParams($this, $params); Yii::debug('Running action: ' . get_class($this) . '::run(), invoked by ' . get_class($this->controller), __METHOD__); if (Yii::$app->requestedParams === null) { Yii::$app->requestedParams = $args; } if ($this->beforeRun()) { $result = call_user_func_array([$this, 'run'], $args); $this->afterRun(); return $result; } return null;
} $result = null; if ($runAction && $this->beforeAction($action)) { // run the action $result = $action->runWithParams($params); $result = $this->afterAction($action, $result); // call afterAction on modules foreach ($modules as $module) { /* @var $module Module */
$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();
require(__DIR__ . '/../config/main.php'), require(__DIR__ . '/../config/main-local.php') ); $application = new yii\web\Application($config); $application->run();
$_GET = [ 'ename' => 'iu', 'major_urlcode' => 'computer', ]; $_SESSION = [ '__flash' => [], ];