mirror of
https://github.com/Neetpone/ponepaste.git
synced 2025-03-12 14:40:09 +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 (!empty($filter_value)) {
|
||||||
$pastes = $pastes->where('title', 'LIKE', '%' . escapeLikeQuery($filter_value) . '%')
|
if ($filter_value === 'untagged') {
|
||||||
->orWhereHas('tags', function($q) use ($filter_value) {
|
$pastes = $pastes->doesntHave('tags');
|
||||||
$q->where('name', 'LIKE', '%' . escapeLikeQuery($filter_value) . '%');
|
} 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();
|
$total_results = $pastes->count();
|
||||||
|
|
Loading…
Add table
Reference in a new issue