Permalink
Browse files

Fix search bug

  • Loading branch information...
1 parent d5b1b92 commit c1d06015fac64d5f6f8504d19a8f47ff80cfdecb @yhbyun yhbyun committed Jul 1, 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 c1d0601

Please sign in to comment.