Skip to content

Commit

Permalink
fix when not using decimal points for numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
David Fernández committed Jun 16, 2015
1 parent ac88330 commit d06e228
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/SearchableTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,9 @@ protected function addSelectsToQuery(Builder $query, array $selects)
protected function filterQueryWithRelevance(Builder $query, array $selects, $relevance_count)
{
$comparator = $this->getDatabaseDriver() != 'mysql' ? implode(' + ', $selects) : 'relevance';

$relevance_count=number_format($relevance_count,2,'.','');

$query->havingRaw("$comparator > $relevance_count");
$query->orderBy('relevance', 'desc');

Expand Down

0 comments on commit d06e228

Please sign in to comment.