Skip to content

Commit

Permalink
Merge pull request #178 from Hvitgar/master
Browse files Browse the repository at this point in the history
fixed pgsql bug
  • Loading branch information
nicolaslopezj authored Aug 10, 2018
2 parents ca3630e + 2791ec4 commit cfd888b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/SearchableTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,12 @@ protected function filterQueryWithRelevance(Builder $query, array $selects, $rel

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

$query->havingRaw("$comparator >= $relevance_count");
if ($this->getDatabaseDriver() == 'mysql') {
$bindings = [];
} else {
$bindings = $this->search_bindings;
}
$query->havingRaw("$comparator >= $relevance_count", $bindings);
$query->orderBy('relevance', 'desc');

// add bindings to postgres
Expand Down Expand Up @@ -339,4 +344,3 @@ protected function mergeQueries(Builder $clone, Builder $original) {
$original->withoutGlobalScopes()->setBindings($mergedBindings);
}
}

0 comments on commit cfd888b

Please sign in to comment.