Commit 0fdb52edf7cecbc8cd254fdb46e829335a6db92a
1 parent
66386df5
add variantSku
Showing
1 changed file
with
3 additions
and
4 deletions
Show diff stats
models/ProductFrontendSearch.php
@@ -196,6 +196,8 @@ | @@ -196,6 +196,8 @@ | ||
196 | } else { | 196 | } else { |
197 | $query = Product::find(); | 197 | $query = Product::find(); |
198 | } | 198 | } |
199 | + | ||
200 | + $query->select('MAX('.ProductVariant::tableName() . '.price) as max, MIN('.ProductVariant::tableName() . '.price) as min)'); | ||
199 | $query->joinWith('variant'); | 201 | $query->joinWith('variant'); |
200 | 202 | ||
201 | // Price filter fix | 203 | // Price filter fix |
@@ -209,9 +211,6 @@ | @@ -209,9 +211,6 @@ | ||
209 | 1, | 211 | 1, |
210 | ] | 212 | ] |
211 | ); | 213 | ); |
212 | - return [ | ||
213 | - 'min' => $query->min(ProductVariant::tableName() . '.price'), | ||
214 | - 'max' => $query->max(ProductVariant::tableName() . '.price'), | ||
215 | - ]; | 214 | + return $query->all(); |
216 | } | 215 | } |
217 | } | 216 | } |
218 | \ No newline at end of file | 217 | \ No newline at end of file |