mirror of
https://github.com/flarum/framework.git
synced 2025-03-15 00:05:12 +08:00
resume chain in query builder
This commit is contained in:
parent
521834f5da
commit
5d1fe9b815
@ -97,12 +97,13 @@ class PostPolicy extends AbstractPolicy
|
||||
->from('discussions')
|
||||
->whereColumn('discussions.id', 'posts.discussion_id')
|
||||
->where(function ($query) use ($actor) {
|
||||
$query->whereRaw('1=0');
|
||||
$query->orWhere(function ($query) use ($actor) {
|
||||
$this->events->dispatch(
|
||||
new ScopeModelVisibility(Discussion::query()->setQuery($query), $actor, 'hidePosts')
|
||||
);
|
||||
});
|
||||
$query
|
||||
->whereRaw('1=0')
|
||||
->orWhere(function ($query) use ($actor) {
|
||||
$this->events->dispatch(
|
||||
new ScopeModelVisibility(Discussion::query()->setQuery($query), $actor, 'hidePosts')
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user