CDbException

Таблица "tovars", упомянутая в записи active record класса "Tovars", не найдена в базе данных.

/home/svetnew/web/svet-lussole.ru/public_html/framework/db/ar/CActiveRecord.php(2310)

2298     private $_model;
2299 
2300     /**
2301      * Constructor.
2302      * @param CActiveRecord $model the model instance
2303      */
2304     public function __construct($model)
2305     {
2306         $this->_model=$model;
2307 
2308         $tableName=$model->tableName();
2309         if(($table=$model->getDbConnection()->getSchema()->getTable($tableName))===null)
2310             throw new CDbException(Yii::t('yii','The table "{table}" for active record class "{class}" cannot be found in the database.',
2311                 array('{class}'=>get_class($model),'{table}'=>$tableName)));
2312         if($table->primaryKey===null)
2313         {
2314             $table->primaryKey=$model->primaryKey();
2315             if(is_string($table->primaryKey) && isset($table->columns[$table->primaryKey]))
2316                 $table->columns[$table->primaryKey]->isPrimaryKey=true;
2317             elseif(is_array($table->primaryKey))
2318             {
2319                 foreach($table->primaryKey as $name)
2320                 {
2321                     if(isset($table->columns[$name]))
2322                         $table->columns[$name]->isPrimaryKey=true;

Stack Trace

#2
+
 /home/svetnew/web/svet-lussole.ru/public_html/protected/controllers/OptionsController.php(338): CActiveDataProvider->__construct("Tovars", array("criteria" => array("condition" => "`disp`=1 and `id`IN(6,53,119,121,126,147,182,183,184,200,207,242...", "order" => "`amount` desc"), "pagination" => array("pageSize" => 32, "pageVar" => "page")))
333                     $namesort = isset($sort[0]) ? $sort[0] : "amount"; // сортировка по умолчанию - по количеству от самого большего до "снят с производства (-777)"
334                     $ordersort = isset($sort[1]) ? $sort[1] : "desc";
335 
336                     $size = isset($_SESSION['size']) ? $_SESSION['size'] : 32;
337 
338                     $tovars = new CActiveDataProvider('Tovars', array('criteria' => array('condition' => '`disp`=1 and `id`IN(' . implode(',', $idtovs) . ')', 'order' => '`' . $namesort . '` ' . $ordersort), 'pagination' => array('pageSize' => $size, 'pageVar' => 'page')));
339 
340                     unset($idtovs);
341 
342                     if (!empty($tovars) && $tovars->getTotalItemCount() > 0) // если товар есть
343                     {
#17
+
 /home/svetnew/web/svet-lussole.ru/public_html/index.php(9): CApplication->run()
4 $config=dirname(__FILE__).'/protected/config/main.php';
5 
6 defined('YII_DEBUG') or define('YII_DEBUG',true);
7 
8 require_once($yii);
9 Yii::createWebApplication($config)->run();
2024-03-19 02:59:51 Apache/2.4.18 (Ubuntu) mod_fcgid/2.3.9 OpenSSL/1.0.2g Yii Framework/1.1.13