Commit 45d90ceb155d7d0e3d047ec91497b1bcca262162
1 parent
6023a0e4
big commti
Showing
1 changed file
with
3 additions
and
5 deletions
Show diff stats
common/modules/product/helpers/ProductHelper.php
| ... | ... | @@ -144,7 +144,7 @@ |
| 144 | 144 | $product_categories[] = $category->category_id; |
| 145 | 145 | } |
| 146 | 146 | $query = Product::find() |
| 147 | - ->select('product.product_id') | |
| 147 | + | |
| 148 | 148 | ->innerJoinWith('variant') |
| 149 | 149 | ->joinWith('category') |
| 150 | 150 | ->where([ |
| ... | ... | @@ -173,11 +173,9 @@ |
| 173 | 173 | ]); |
| 174 | 174 | $query->groupBy('product.product_id'); |
| 175 | 175 | $query->limit($count); |
| 176 | - $products = $query->asArray() | |
| 176 | + $products = $query | |
| 177 | 177 | ->all(); |
| 178 | - foreach($products as &$_product) { | |
| 179 | - $_product = Product::findOne($_product[ 'product_id' ]); | |
| 180 | - } | |
| 178 | + | |
| 181 | 179 | return $products; |
| 182 | 180 | } |
| 183 | 181 | ... | ... |