CDbException

CDbCommand neizdevās izpildīt SQL vaicājumu: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'leader.username' in 'order clause'. The SQL statement executed was: SELECT * FROM `alp_ascent` `t` WHERE (route_id=:ycp1) AND (t.delete_time IS NULL) ORDER BY leader.username LIMIT 15

/home/climbing/public_html/alp/protected/vendor/yii_1.1.14/framework/db/CDbCommand.php(543)

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

Stack Trace

#7
+
 /home/climbing/public_html/alp/protected/extensions/booster2/widgets/TbGridView.php(68): CGridView->init()
63      *
64      * Initializes the widget.
65      */
66     public function init()
67     {
68         parent::init();
69 
70         $classes = array('table');
71         if (isset($this->type)) {
72             if (is_string($this->type)) {
73                 $this->type = explode(' ', $this->type);
#10
+
 /home/climbing/public_html/alp/protected/views/route/routeascents.php(7): CBaseController->widget("TbGridView", array("id" => "post-grid", "dataProvider" => CActiveDataProvider, "template" => "{summary}{pager}{items}{pager}", "pager" => array("class" => "TbPager", "displayFirstAndLast" => true), ...))
02 $post_model = new Ascent;
03 $criteria = new CDbCriteria;
04 $criteria->compare('route_id', $model->id);
05 $this->widget('TbGridView',
06     array(
07         'id' => 'post-grid',
08         'dataProvider' => $post_model->search($criteria),
09         //'filter' => $post_model,
10         #'responsiveTable' => true,
11         'template' => '{summary}{pager}{items}{pager}',
12         'pager' => array(
#14
+
 /home/climbing/public_html/alp/protected/views/route/view.php(82): CController->renderPartial("routeascents", array("model" => Route), true, true)
77                     'content'=>$this->renderPartial('routeposts', array('model'=>$model), true, true), 
78                     'active'=>true
79                 ),
80                 array(
81                     'label'=>Yii::t('app','Ascents'), 
82                     'content'=>$this->renderPartial('routeascents', array('model'=>$model), true, true), 
83                     'active'=>false
84                 ),
85                 array(
86                     'label'=>Yii::t('app','Members'), 
87                     'content'=>$this->renderPartial('routerating', array('model'=>$model), true, true), 
2024-03-28 18:27:18 Apache Yii Framework/1.1.14