diff --git a/common/modules/product/helpers/ProductHelper.php b/common/modules/product/helpers/ProductHelper.php index a6ff9db..97ebc85 100755 --- a/common/modules/product/helpers/ProductHelper.php +++ b/common/modules/product/helpers/ProductHelper.php @@ -144,7 +144,7 @@ $product_categories[] = $category->category_id; } $query = Product::find() - ->select('product.product_id') + ->innerJoinWith('variant') ->joinWith('category') ->where([ @@ -173,11 +173,9 @@ ]); $query->groupBy('product.product_id'); $query->limit($count); - $products = $query->asArray() + $products = $query ->all(); - foreach($products as &$_product) { - $_product = Product::findOne($_product[ 'product_id' ]); - } + return $products; } -- libgit2 0.21.4