mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-06-24 22:51:23 +08:00
Done a refactor pass on PermissionService
Could do with splitting out into seperate query/build classess really. Closes #2633.
This commit is contained in:
@ -65,7 +65,7 @@ class ViewService
|
||||
{
|
||||
$skipCount = $count * $page;
|
||||
$query = $this->permissionService
|
||||
->filterRestrictedEntityRelations($this->view, 'views', 'viewable_id', 'viewable_type', $action)
|
||||
->filterRestrictedEntityRelations($this->view->newQuery(), 'views', 'viewable_id', 'viewable_type', $action)
|
||||
->select('*', 'viewable_id', 'viewable_type', DB::raw('SUM(views) as view_count'))
|
||||
->groupBy('viewable_id', 'viewable_type')
|
||||
->orderBy('view_count', 'desc');
|
||||
|
Reference in New Issue
Block a user