CDbException

CDbCommand не удалось исполнить SQL-запрос: SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens. The SQL statement executed was: SELECT image.filename AS image, image.alt AS image_alt, image.title AS image_title, `domain_product`.`id` AS `t0_c0`, `domain_product_category`.`id` AS `t1_c0`, `domain_product_category`.`product_id` AS `t1_c1`, `domain_product_category`.`category_id` AS `t1_c2`, `domain_product_category`.`domain_id` AS `t1_c3`, `product`.`id` AS `t2_c0`, `product`.`name` AS `t2_c1`, `product`.`type` AS `t2_c2`, `product`.`full_name` AS `t2_c3`, `product`.`alias` AS `t2_c4`, `product`.`page_title` AS `t2_c5`, `product`.`meta_keywords` AS `t2_c6`, `product`.`meta_description` AS `t2_c7`, `product`.`short_description` AS `t2_c8`, `product`.`description` AS `t2_c9`, `product`.`tab_review` AS `t2_c10`, `product`.`tab_original` AS `t2_c11`, `product`.`tab_capability` AS `t2_c12`, `product`.`tab_features` AS `t2_c13`, `product`.`tab_options` AS `t2_c14`, `product`.`price` AS `t2_c15`, `product`.`price_old` AS `t2_c16`, `product`.`action_icon` AS `t2_c17`, `product`.`brand_id` AS `t2_c18`, `product`.`sticker_bottom` AS `t2_c19`, `product`.`discontinued` AS `t2_c20`, `product`.`position` AS `t2_c21`, `product`.`visible` AS `t2_c22`, `product`.`item_id` AS `t2_c23`, `domain_category`.`id` AS `t3_c0`, `domain_category`.`category_id` AS `t3_c1`, `domain_category`.`domain_id` AS `t3_c2`, `domain_category`.`alias` AS `t3_c3`, `domain_category`.`page_title` AS `t3_c4`, `domain_category`.`meta_keywords` AS `t3_c5`, `domain_category`.`meta_description` AS `t3_c6`, `domain_category`.`description_top` AS `t3_c7`, `domain_category`.`description_bottom` AS `t3_c8`, `domain_category`.`menu_name` AS `t3_c9`, `domain_category`.`name` AS `t3_c10`, `domain_category`.`singular_name` AS `t3_c11`, `domain_category`.`position` AS `t3_c12`, `domain_category`.`filename_jpg` AS `t3_c13`, `domain_category`.`filename_png` AS `t3_c14`, `domain_category`.`image_alt` AS `t3_c15`, `domain_category`.`image_title` AS `t3_c16`, `brand`.`id` AS `t4_c0`, `brand`.`name` AS `t4_c1`, `brand`.`description` AS `t4_c2`, `brand`.`position` AS `t4_c3`, `image`.`id` AS `t5_c0`, `image`.`filename` AS `t5_c1`, `image`.`product_id` AS `t5_c2`, `image`.`position` AS `t5_c3`, `image`.`type` AS `t5_c4`, `image`.`alt` AS `t5_c5`, `image`.`title` AS `t5_c6` FROM `domain_product` `domain_product` LEFT OUTER JOIN `domain_product_category` `domain_product_category` ON (`domain_product_category`.`product_id`=`domain_product`.`id`) LEFT OUTER JOIN `product` `product` ON (`product`.`id`=`domain_product`.`product_id`) LEFT OUTER JOIN `domain_category` `domain_category` ON (domain_product_category.category_id = domain_category.id) LEFT OUTER JOIN `brand` `brand` ON (brand.id = product.brand_id) LEFT OUTER JOIN `image` `image` ON (image.product_id = product.id) WHERE ((domain_product_category.category_id IN (2163) AND
product.visible AND
image.position = 0) AND (brand.id = :brand_id)) ORDER BY product.position ASC, image.position

/home/yamaguchi_array/data/www/admin-massage-chairs.ru/framework/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

#6
+
 /home/yamaguchi_array/data/www/admin-massage-chairs.ru/protected/sites/frontend/models/DomainProduct.php(61): CActiveRecord->findAll(CDbCriteria)
56         if($brandId) {
57             $criteria->addCondition("brand.id = :brand_id");
58             $criteria->params[':brand_id'] = $brandId;
59         }
60 
61         $products = self::model()->findAll($criteria);
62 
63 
64         $categories = self::getCategoriesAliasByProducts($products);
65 
66         return self::normalizeProducts($products, $categories);
#7
+
 /home/yamaguchi_array/data/www/admin-massage-chairs.ru/protected/sites/frontend/controllers/CatalogController.php(100): DomainProduct::getProductsByExtraCategoriesIds("2163", "5")
095         if(!isset($category->extra)) {
096             // Товары основной категории
097             $products = Product::model()->getProductsByCategoriesIds($category_ids, $brandId); // Все товары текущей категории и вложенных
098         } else {
099             // Товары Дополнительной категории
100             $products = DomainProduct::model()->getProductsByExtraCategoriesIds($category_ids, $brandId); // Все товары текущей категории и вложенных
101         }
102 //        echo '<pre>'; print_r($products); echo '</pre>';
103         $this->setPageHead($category);
104 
105         $this->render('view', array(
#8
+
 /home/yamaguchi_array/data/www/admin-massage-chairs.ru/protected/sites/frontend/controllers/SiteController.php(96): CatalogController->showCategory(Alias)
091                 $controller = Yii::app()->createController('product');
092                 $controller[0]->showProduct($node);
093                 break;
094             case 'category':
095                 $controller = Yii::app()->createController('catalog');
096                 $controller[0]->showCategory($node);
097                 break;
098             case 'extrapage':
099                 $controller = Yii::app()->createController('extrapage');
100                 $controller[0]->actionView($node->alias);
101                 break;
2024-03-28 15:44:17 Apache/2.2.22 (@RELEASE@) Yii Framework/1.1.13