mirror of
https://github.com/flarum/framework.git
synced 2024-12-01 22:43:41 +08:00
Ensure compatibility with DB table prefix
This commit is contained in:
parent
dfaf1bad09
commit
dd1f2d46fd
|
@ -82,7 +82,7 @@ class DiscussionPolicy extends AbstractPolicy
|
|||
return $query->selectRaw('1')
|
||||
->from('discussions_tags')
|
||||
->whereIn('tag_id', Tag::getIdsWhereCannot($actor, 'viewDiscussions'))
|
||||
->whereRaw('discussions.id = discussion_id');
|
||||
->whereColumn('discussions.id', 'discussion_id');
|
||||
});
|
||||
|
||||
// Hide discussions with no tags if the user doesn't have that global
|
||||
|
@ -106,7 +106,7 @@ class DiscussionPolicy extends AbstractPolicy
|
|||
return $query->selectRaw('1')
|
||||
->from('discussions_tags')
|
||||
->whereIn('tag_id', Tag::getIdsWhereCan($actor, 'discussion.'.$ability))
|
||||
->whereRaw('discussions.id = discussion_id');
|
||||
->whereColumn('discussions.id', 'discussion_id');
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ class FlagPolicy extends AbstractPolicy
|
|||
return $query->selectRaw('1')
|
||||
->from('discussions_tags')
|
||||
->whereIn('tag_id', Tag::getIdsWhereCannot($actor, 'discussion.viewFlags'))
|
||||
->whereRaw('discussions.id = discussion_id');
|
||||
->whereColumn('discussions.id', 'discussion_id');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -48,7 +48,7 @@ class TagGambit extends AbstractRegexGambit
|
|||
$query->orWhereExists(function ($query) {
|
||||
$query->selectRaw('1')
|
||||
->from('discussions_tags')
|
||||
->whereRaw('discussions.id = discussion_id');
|
||||
->whereColumn('discussions.id', 'discussion_id');
|
||||
}, ! $negate);
|
||||
} else {
|
||||
$id = $this->tags->getIdForSlug($slug);
|
||||
|
@ -56,7 +56,7 @@ class TagGambit extends AbstractRegexGambit
|
|||
$query->orWhereExists(function ($query) use ($id) {
|
||||
$query->selectRaw('1')
|
||||
->from('discussions_tags')
|
||||
->whereRaw('discussions.id = discussion_id')
|
||||
->whereColumn('discussions.id', 'discussion_id')
|
||||
->where('tag_id', $id);
|
||||
}, $negate);
|
||||
}
|
||||
|
|
|
@ -53,7 +53,7 @@ class FilterDiscussionListByTags
|
|||
return $query->selectRaw('1')
|
||||
->from('discussions_tags')
|
||||
->whereIn('tag_id', Tag::where('is_hidden', 1)->pluck('id'))
|
||||
->whereRaw('discussions.id = discussion_id');
|
||||
->whereColumn('discussions.id', 'discussion_id');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user