mirror of
https://github.com/flarum/framework.git
synced 2025-02-24 03:07:55 +08:00
parent
5506b3f76f
commit
7ae7603342
@ -42,15 +42,14 @@ class TagGambit extends AbstractRegexGambit
|
|||||||
{
|
{
|
||||||
$slugs = explode(',', trim($matches[1], '"'));
|
$slugs = explode(',', trim($matches[1], '"'));
|
||||||
|
|
||||||
// TODO: implement $negate
|
$search->getQuery()->where(function ($query) use ($slugs, $negate) {
|
||||||
$search->getQuery()->where(function ($query) use ($slugs) {
|
|
||||||
foreach ($slugs as $slug) {
|
foreach ($slugs as $slug) {
|
||||||
if ($slug === 'untagged') {
|
if ($slug === 'untagged') {
|
||||||
$query->orWhereNotExists(function ($query) {
|
$query->orWhereExists(function ($query) {
|
||||||
$query->selectRaw('1')
|
$query->selectRaw('1')
|
||||||
->from('discussions_tags')
|
->from('discussions_tags')
|
||||||
->whereRaw('discussions.id = discussion_id');
|
->whereRaw('discussions.id = discussion_id');
|
||||||
});
|
}, !$negate);
|
||||||
} else {
|
} else {
|
||||||
$id = $this->tags->getIdForSlug($slug);
|
$id = $this->tags->getIdForSlug($slug);
|
||||||
|
|
||||||
@ -59,7 +58,7 @@ class TagGambit extends AbstractRegexGambit
|
|||||||
->from('discussions_tags')
|
->from('discussions_tags')
|
||||||
->whereRaw('discussions.id = discussion_id')
|
->whereRaw('discussions.id = discussion_id')
|
||||||
->where('tag_id', $id);
|
->where('tag_id', $id);
|
||||||
});
|
}, $negate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user