CDbException

CDbCommand không thể thi hành câu truy vấn SQL: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'province_id' in 'field list'. The SQL statement executed was: SELECT * FROM `province` `t` WHERE id IN (SELECT DISTINCT province_id FROM product WHERE cat_id IN (287)) ORDER BY t.ord ASC, t.id DESC

/home/minhtam/domains/cameralongxuyen.com/public_html/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

#3
+
 /home/minhtam/domains/cameralongxuyen.com/public_html/protected/models/Cat.php(303): CActiveRecord->findAll(array("condition" => "id IN (SELECT DISTINCT province_id FROM product WHERE cat_id IN ...", "order" => "t.ord ASC, t.id DESC"))
298             }
299         }
300         return Province::model()->findAll(array(
301             'condition' => 'id IN (SELECT DISTINCT province_id FROM product WHERE cat_id IN ('.implode(',', $arr_ids).'))',
302             'order' => 't.ord ASC, t.id DESC'
303         ));
304     }
305     
306 }
#4
+
 /home/minhtam/domains/cameralongxuyen.com/public_html/protected/views/site/pages/listproduct_brand.php(44): Cat->getProvince()
39                 </div>
40             </div>
41             <?php
42         }
43 
44         $province_list = $cat->getProvince();
45         if (!empty($province_list)) {
46             ?>
47             <div class="_box catmenu">
48                 <p><i class="fa fa-bars"></i> Quốc gia sản xuất</p>
49                 <div>
#9
+
 /home/minhtam/domains/cameralongxuyen.com/public_html/protected/controllers/SiteController.php(539): CController->render("pages/listproduct_brand", array("model" => array(Product), "pages" => CPagination, "count" => "1", "cat" => Cat, ...))
534             'model' => $model,
535             'pages' => $pages,
536             'count' => $count,
537             'cat' => $cat,
538             'brand' => $brand
539         ));
540     }
541 
542     /*
543     * LIỆT KÊ SẢN PHẨM THEO DANH MỤC
544     */
2024-03-29 05:06:42 LiteSpeed Yii Framework/1.1.17