Skip to content

Commit

Permalink
Alterado FilterSearch
Browse files Browse the repository at this point in the history
  • Loading branch information
Renato Moura committed Nov 24, 2017
1 parent 75f0c65 commit 9ce00eb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/NwLaravel/Repositories/Criterias/Filters/FilterSearch.php
Expand Up @@ -57,6 +57,9 @@ public function filter($query, $key, $value)

if (!empty($value)) {
$search = in_array($condition, ["like", "ilike"]) ? "%{$value}%" : $value;
if ($field == 'id') {
$search = intval($search);
}
$query->orWhere($this->table.'.'.$field, $condition, $search);
}
}
Expand Down

0 comments on commit 9ce00eb

Please sign in to comment.