Skip to content

Commit

Permalink
Merge pull request #60 from JulienTant/patch-3
Browse files Browse the repository at this point in the history
Surround column name with backtick (fix #59)
  • Loading branch information
nicolaslopezj committed May 31, 2015
2 parents 8b049e0 + d14110c commit 1ee4b3f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/SearchableTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ protected function getSearchQuery(Builder $query, $column, $relevance, array $wo
* @return string
*/
protected function getCaseCompare($column, $compare, $relevance) {
$field = "LOWER(" . $column . ") " . $compare . " ?";
$field = "LOWER(`" . $column . "`) " . $compare . " ?";
return '(case when ' . $field . ' then ' . $relevance . ' else 0 end)';
}

Expand Down

0 comments on commit 1ee4b3f

Please sign in to comment.