Skip to content

Commit

Permalink
Merge pull request #62 from thoughts1053/master
Browse files Browse the repository at this point in the history
Fix for searching joined table column names since adding back ticks
  • Loading branch information
nicolaslopezj committed Jun 3, 2015
2 parents 1ee4b3f + a127b20 commit ac88330
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/SearchableTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ protected function getSearchQuery(Builder $query, $column, $relevance, array $wo
* @return string
*/
protected function getCaseCompare($column, $compare, $relevance) {
$column = str_replace('.', '`.`', $column);
$field = "LOWER(`" . $column . "`) " . $compare . " ?";
return '(case when ' . $field . ' then ' . $relevance . ' else 0 end)';
}
Expand Down

0 comments on commit ac88330

Please sign in to comment.