CDbException

CDbCommand не удалось исполнить SQL-запрос: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'rca.sort_order' in 'order clause'. The SQL statement executed was: SELECT r.*, rl.name AS nameLang, rl.description AS descriptionLang, (SELECT NOW() BETWEEN r.action_from AND r.action_to )as is_action, (SELECT DATE_ADD(r.created,INTERVAL 7 DAY)>NOW() )as is_new FROM rollers AS r LEFT JOIN rollersLang AS rl ON rl.rollersId = r.id AND rl.lang = 'ru' WHERE r.sys_enabled = 1 AND r.enabled = 1 AND r.type!='3'GROUP BY r.id ORDER BY rca.sort_order ASC, r.id DESC LIMIT 600 OFFSET 0

/var/www/cmex.ru/data/common/lib/Yii/db/CDbCommand.php(541)

529         {
530             if($this->_connection->enableProfiling)
531                 Yii::endProfile('system.db.CDbCommand.query('.$this->getText().$par.')','system.db.CDbCommand.query');
532 
533             $errorInfo=$e instanceof PDOException ? $e->errorInfo : null;
534             $message=$e->getMessage();
535             Yii::log(Yii::t('yii','CDbCommand::{method}() failed: {error}. The SQL statement executed was: {sql}.',
536                 array('{method}'=>$method, '{error}'=>$message, '{sql}'=>$this->getText().$par)),CLogger::LEVEL_ERROR,'system.db.CDbCommand');
537 
538             if(YII_DEBUG)
539                 $message.='. The SQL statement executed was: '.$this->getText().$par;
540 
541             throw new CDbException(Yii::t('yii','CDbCommand failed to execute the SQL statement: {error}',
542                 array('{error}'=>$message)),(int)$e->getCode(),$errorInfo);
543         }
544     }
545 
546     /**
547      * Builds a SQL SELECT statement from the given query specification.
548      * @param array $query the query specification in name-value pairs. The following
549      * query options are supported: {@link select}, {@link distinct}, {@link from},
550      * {@link where}, {@link join}, {@link group}, {@link having}, {@link order},
551      * {@link limit}, {@link offset} and {@link union}.
552      * @return string the SQL statement
553      * @since 1.1.6

Stack Trace

#1
+
 /var/www/cmex.ru/data/frontend/controllers/CategoryController.php(250): CDbCommand->queryAll()
245                 //}
246                 $sql.= "ORDER BY rca.sort_order ASC, r.id DESC ";
247                 
248                 $sql.="LIMIT " . (int) $limit . " OFFSET " . (int) $offset;
249 
250         $model = Yii::app()->db->createCommand($sql)->queryAll();
251 
252         foreach ($model as $key => $roller) {
253             $sql = "SELECT c.country, cl.country AS countryLang " .
254                     "FROM countries AS c " .
255                     "LEFT JOIN countriesLang AS cl ON cl.countriesId = c.id AND cl.lang = '" . Yii::app()->language . "', " .
#2
+
 /var/www/cmex.ru/data/frontend/controllers/CategoryController.php(100): CategoryController->loadRollers(0, 0, 600, 0, ...)
095         $data['model_countries'] = $this->loadCountries();
096         
097         $data['count_rollers'] = $this->countRollers($model_id, $country_id, $type_id);
098         $data['model_banners'] = $this->bannerRollers();
099         
100         $rollers = $this->loadRollers($model_id, $country_id, $base_limit, $limit, $type_id);
101         if($rollers){
102             foreach( $rollers as $key=>$val){
103                 $rollers[$key]['price_format'] = $currency->format($val['price']);
104             }
105         }
#10
+
 /var/www/cmex.ru/data/common/components/WebApplication.php(41): CWebApplication->runController("category/index")
36                 }
37             }
38         }
39         // end serg
40         try {
41             parent::runController($route);
42         } catch (CHttpException $e) {
43             if (@$_SERVER['REQUEST_METHOD'] == 'OPTIONS' && @$_SERVER['REQUEST_URI'] == '*') {
44                 Yii::app()->end('Hello, friend!');
45             } else
46                 throw $e;
2024-03-28 10:24:38 Apache/2.4.10 (Debian) Yii Framework/1.1.13