diff --git a/common/modules/product/helpers/ProductHelper.php b/common/modules/product/helpers/ProductHelper.php index 992fabd..3132b60 100755 --- a/common/modules/product/helpers/ProductHelper.php +++ b/common/modules/product/helpers/ProductHelper.php @@ -1,7 +1,7 @@ getTree(); // with('categoryName')-> } - + public static function getBrands() { return Brand::find(); // ->with('brandName') } - + /* * Return custom filter-option link * @var array $filter @@ -74,7 +74,7 @@ } return $result; } - + public static function addLastProsucts($product_id) { $last_products = self::getLastProducts(); @@ -86,7 +86,7 @@ Yii::$app->session->set('last_products', $last_products); } } - + public static function getLastProducts($as_object = false) { $last_products = Yii::$app->session->get('last_products', [ ]); @@ -103,7 +103,7 @@ } return array_reverse($last_products); } - + public static function getSpecialProducts($type, $count, $sort = NULL) { switch($type) { @@ -128,7 +128,7 @@ ->limit($count)/*->orderBy($sort)*/ ->all(); } - + public static function getSimilarProducts($product, $count = 10) { if(!is_object($product)) { @@ -137,7 +137,7 @@ ->with('enabledVariants') ->one(); } - + if(!$product->properties) { return [ ]; } @@ -182,7 +182,7 @@ } return $products; } - + /** * @param ActiveQuery $query * @param $params @@ -217,9 +217,9 @@ ]); } } - + foreach($params as $key => $param) { - + switch($key) { case 'special': foreach($param as $key => $value) { @@ -249,7 +249,7 @@ break; default: $query->andWhere( - Product::tableName() . '.product_id IN ( + Product::tableName() . '.product_id IN ( SELECT DISTINCT products FROM ( SELECT product_id AS products @@ -263,16 +263,16 @@ INNER JOIN tax_option ON tax_option.tax_option_id = product_variant_option.option_id INNER JOIN tax_group ON tax_group.tax_group_id = tax_option.tax_group_id WHERE tax_group.alias LIKE \''. $key .'\' AND tax_option.alias IN (\'' . implode('\',\'', $param) . '\')) - ) - ) AS table_name + ) + ) AS table_name )' ); } - + } - + } - + public static function productCountQuery($category = NULL, $params, $excludeKeys = [ ]) { $p = [ ]; @@ -289,14 +289,14 @@ } ProductHelper::_setQueryParams($query, $params); $query->select([ 'COUNT(product.product_id)' ]); - + return $query; } - + public static function addLastCategory($category_id) { \Yii::$app->session->set('last_category_id', $category_id); } - + public static function getLastCategory() { return \Yii::$app->session->get('last_category_id'); } diff --git a/common/modules/product/widgets/specialProducts.php b/common/modules/product/widgets/specialProducts.php index dd2e00b..3bab7c4 100755 --- a/common/modules/product/widgets/specialProducts.php +++ b/common/modules/product/widgets/specialProducts.php @@ -10,7 +10,7 @@ use Yii; class specialProducts extends Widget { public $type = 'top'; - public $count = 8; + public $count = 15; public $sort = 'default'; -- libgit2 0.21.4