mirror of
https://github.com/flarum/framework.git
synced 2024-11-30 05:13:37 +08:00
Update gambit for search API
This commit is contained in:
parent
e41e50f423
commit
8ba856df79
|
@ -36,13 +36,14 @@ class TagGambit extends GambitAbstract
|
||||||
* @param \Flarum\Core\Search\SearcherInterface $searcher
|
* @param \Flarum\Core\Search\SearcherInterface $searcher
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function conditions($matches, SearcherInterface $searcher)
|
protected function conditions(SearcherInterface $searcher, array $matches, $negate)
|
||||||
{
|
{
|
||||||
$slugs = explode(',', trim($matches[1], '"'));
|
$slugs = explode(',', trim($matches[1], '"'));
|
||||||
|
|
||||||
$searcher->query()->where(function ($query) use ($slugs) {
|
// TODO: implement $negate
|
||||||
|
$searcher->getQuery()->where(function ($query) use ($slugs) {
|
||||||
foreach ($slugs as $slug) {
|
foreach ($slugs as $slug) {
|
||||||
if ($slug === 'uncategorized') {
|
if ($slug === 'untagged') {
|
||||||
$query->orWhereNotExists(function ($query) {
|
$query->orWhereNotExists(function ($query) {
|
||||||
$query->select(app('db')->raw(1))
|
$query->select(app('db')->raw(1))
|
||||||
->from('discussions_tags')
|
->from('discussions_tags')
|
||||||
|
|
Loading…
Reference in New Issue
Block a user