diff --git a/models/ProductFrontendSearch.php b/models/ProductFrontendSearch.php index 654caae..b9107d0 100755 --- a/models/ProductFrontendSearch.php +++ b/models/ProductFrontendSearch.php @@ -196,8 +196,6 @@ } else { $query = Product::find(); } - - $query->select('MAX('.ProductVariant::tableName() . '.price) as max, MIN('.ProductVariant::tableName() . '.price) as min'); $query->joinWith('variant'); // Price filter fix @@ -211,6 +209,9 @@ 1, ] ); - return $query->all(); + return [ + 'min' => $query->min(ProductVariant::tableName() . '.price'), + 'max' => $query->max(ProductVariant::tableName() . '.price'), + ]; } } \ No newline at end of file -- libgit2 0.21.4