Permalink
Browse files

Merge pull request #85 from yhbyun/patch-1

Fix the search bug
  • Loading branch information...
2 parents d5b1b92 + c1d0601 commit 29ce3f930fde479589f11f9f9dc48462343069d3 @msurguy msurguy committed Oct 15, 2015
Showing with 2 additions and 4 deletions.
  1. +2 −4 app/Tricks/Repositories/Eloquent/TrickRepository.php
@@ -199,12 +199,10 @@ public function searchByTermPaginated($term, $perPage = 12)
->orWhere('title', 'LIKE', '%'.$term.'%')
->orWhere('description', 'LIKE', '%'.$term.'%')
->orWhereHas('tags', function ($query) use ($term) {
- $query->where('title', 'LIKE', '%' . $term . '%')
- ->orWhere('slug', 'LIKE', '%' . $term . '%');
+ $query->where('title', 'LIKE', '%' . $term . '%');
})
->orWhereHas('categories', function ($query) use ($term) {
- $query->where('name', 'LIKE', '%' . $term . '%')
- ->orWhere('slug', 'LIKE', '%' . $term . '%');
+ $query->where('name', 'LIKE', '%' . $term . '%');
})
->orderBy('created_at', 'desc')
->orderBy('title', 'asc')

0 comments on commit 29ce3f9

Please sign in to comment.