CDbException

CDbCommand не удалось исполнить SQL-запрос: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'lk_usoft_ru.pages' doesn't exist. The SQL statement executed was: SELECT t.id, t.title name, COUNT(nt.id) c, "news" part, "" bank_id, t.href href
FROM tbl_news t
INNER JOIN tbl_news_tag nt
ON nt.new_id = t.id
AND t.visible = 1
AND t.is_deleted = 0
AND nt.tag_id IN (3)
GROUP BY t.id

UNION

SELECT t.id, t.title name, COUNT(nt.id) c, "blk" part, t.bank_id bank_id, "" href
FROM bk_blk_bank_questions t
INNER JOIN tbl_bank_questions_tag nt
ON nt.bq_id = t.id
AND nt.tag_id IN (3)
GROUP BY t.id

UNION

SELECT t.id, t.title name, COUNT(nt.id) c, "lesson" part, "" bank_id, "" href
FROM tbl_lessons t
INNER JOIN tbl_lessons_tag nt
ON nt.lesson_id = t.id
AND nt.tag_id IN (3)
GROUP BY t.id

UNION

SELECT t.page_id id, t.page_title name, COUNT(nt.id) c, "page" part, "" bank_id, "" href
FROM pages t
INNER JOIN tbl_pages_tag nt
ON nt.page_id = t.page_id
AND t.page_status = 1
AND t.delete = 0
AND nt.tag_id IN (3)
GROUP BY t.page_id

UNION

SELECT t.id, t.title name, COUNT(nt.id) c, "service" part, "" bank_id, t.url href
FROM tbl_service t
INNER JOIN tbl_services_tag nt
ON nt.service_id = t.id
AND t.is_published = 1
AND nt.tag_id IN (3)
GROUP BY t.id

UNION

SELECT t.id, t.title name, COUNT(nt.id) c, "videoseminar" part, "" bank_id, "" href
FROM video_seminars t
INNER JOIN tbl_video_seminars_tag nt
ON nt.vs_id = t.id
AND t.visible = 1
AND t.is_deleted = 0
AND nt.tag_id IN (3)
GROUP BY t.id

UNION

SELECT t.id, t.name name, COUNT(nt.id) c, "test" part, "" bank_id, "" href
FROM tbl_tests t
INNER JOIN tbl_tests_tag nt
ON nt.test_id = t.id
AND t.visible = 1
AND nt.tag_id IN (3)
GROUP BY t.id

ORDER BY c DESC
LIMIT :limit

/var/www/hosts/framework/db/CDbCommand.php(548)

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

Stack Trace

#1
+
 /var/www/hosts/lk.usoft.ru/protected/modules/tags/models/Tag.php(408): CDbCommand->queryAll()
403             GROUP BY t.id
404 
405             ORDER BY c DESC
406             LIMIT :limit';
407         
408         $query_result = self::model()->commandBuilder->createSqlCommand($sql, $params)->queryAll();
409             
410         $result = array();
411         
412         foreach($query_result as $query_string) {
413             if($query_string['part'] == $part && $query_string['id'] == $id) {
#2
+
 /var/www/hosts/lk.usoft.ru/protected/modules/news/controllers/NewsController.php(105): Tag::findAlso()
100             'userTagsList' => $userTagsList,
101             'last5News' => $this->getLast5NewsByCategory((int)$companyNews->category_id, (int)$companyNews->id),
102             'widgetsBlock' => $this->renderPartial('companyNewsWidgets', ['widgets' => $widgets], true),
103             'subscribe' => $this->getIsSubscribe(),
104             'links' => $this->getNewsLinks((int)$companyNews->id),
105             'also' => Tag::findAlso($model->tags, $model->id, 'news')
106         ]);
107     }
108 
109     /**
110      * Displays a particular model.
#12
+
 /var/www/hosts/lk.usoft.ru/index.php(58): CApplication->run()
53 //Yii::setPathOfAlias('templates', $dirname_file .DIRECTORY_SEPARATOR.'templates');
54 Yii::setPathOfAlias('core',INDEX_DIR.DIRECTORY_SEPARATOR.'core');
55 require_once(__DIR__.DIRECTORY_SEPARATOR.'protected' .DIRECTORY_SEPARATOR.'vendors' .DIRECTORY_SEPARATOR.'Loader.php');
56 Yii::registerAutoloader(array('Loader','systemMainAutoload'));
57 
58 Yii::createWebApplication($config_yii_path)->run();
2025-10-13 10:22:10 nginx/1.18.0 Yii Framework/1.1.15