diff --git a/common/modules/product/helpers/ProductHelper.php b/common/modules/product/helpers/ProductHelper.php index 08420f7..d2b962c 100755 --- a/common/modules/product/helpers/ProductHelper.php +++ b/common/modules/product/helpers/ProductHelper.php @@ -146,7 +146,7 @@ $product_categories[] = $category->category_id; } $query = Product::find() - ->select('product.product_id') + ->innerJoinWith('variant') ->joinWith('category') ->where([ @@ -175,11 +175,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