CHttpException

The requested product does not exist.

/home/rose/public_html/rosedelta.com/public_html/protected/controllers/ProductController.php(728)

716      * If the data model is not found, an HTTP exception will be raised.
717      * @param integer the primary key value. Defaults to null, meaning using the 'id' GET variable
718      */
719     public function loadProduct($id=null)
720     {
721         if($this->_product===null)
722         {   $user = User::model()->with('account')->findByPk(Yii::app()->user->getId());
723             $groupid = Yii::app()->params['categoryRepIds'][$user->account->group_id] ?? 0;
724 
725             if($id!==null || isset($_GET['id']))
726                 $this->_product=Product::model()->findBySql("SELECT products.*, sale_prices.price AS saleprice FROM products LEFT OUTER JOIN sale_prices ON products.id=sale_prices.product_id AND (customer_id=" . $user->account->group_id . (($groupid!=null)?" OR customer_id=".$groupid:"") . ") AND (NOW() BETWEEN startdate AND enddate) WHERE products.active=1 AND products.id = " . ( $id!==null ? $id : $_GET['id']) . " ORDER BY sale_prices.price DESC LIMIT 1");
727             if($this->_product===null)
728                 throw new CHttpException(500,'The requested product does not exist.');
729         }
730         return $this->_product;
731     }
732     
733     private function category_facet($current_cat = 0) {
734         $string = "";
735         $num = 0;
736 
737         $categories = Category::model()->findAllBySql('SELECT * FROM categories WHERE id IN (SELECT parent_id FROM categories WHERE id=' . $current_cat . ')');
738         if (count($categories) > 0) {
739             foreach ($categories as $category) {
740                 list($num, $append) = $this->category_facet($category->id);

Stack Trace

#0
+
 /home/rose/public_html/rosedelta.com/public_html/protected/controllers/ProductController.php(140): ProductController->loadProduct()
135     /**
136      * Shows a particular product.
137      */
138     public function actionShow()
139     {
140         $product = $this->loadProduct();
141         $user = User::model()->with('account')->findByPk(Yii::app()->user->getId());
142         $groupid = Yii::app()->params['categoryRepIds'][$user->account->group_id] ?? 0;
143         $favourites = array();
144         
145         $favourites = Favourite::model()->findAll('customer_id=' . $user->userid . ' AND product_id=' . $product->id);
#13
+
 /home/rose/public_html/officeco/index.php(11): CApplication->run()
06 
07 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
08 
09 
10 require_once($yii);
11 Yii::createWebApplication($config)->run();
12 ?>
2024-04-18 17:00:25 Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.1.33 Yii Framework/1.1.19