mirror of
https://github.com/Neetpone/ponepaste.git
synced 2025-03-12 06:30:07 +01:00
fix: make untagged search work for no-js view too
This commit is contained in:
parent
2bccaf408f
commit
a1cbbc3587
1 changed files with 8 additions and 4 deletions
|
@ -35,10 +35,14 @@ $pastes = Paste::with([
|
|||
|
||||
|
||||
if (!empty($filter_value)) {
|
||||
if ($filter_value === 'untagged') {
|
||||
$pastes = $pastes->doesntHave('tags');
|
||||
} else {
|
||||
$pastes = $pastes->where('title', 'LIKE', '%' . escapeLikeQuery($filter_value) . '%')
|
||||
->orWhereHas('tags', function($q) use ($filter_value) {
|
||||
$q->where('name', 'LIKE', '%' . escapeLikeQuery($filter_value) . '%');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
$total_results = $pastes->count();
|
||||
|
|
Loading…
Add table
Reference in a new issue