mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-05-21 22:36:05 +08:00
Implemented functionality to make books sort function
Also changed public user settings to be stored in session rather than DB. Cleaned existing list view type logic.
This commit is contained in:
@ -102,6 +102,11 @@ class Entity extends Ownable
|
||||
return $this->morphMany(View::class, 'viewable');
|
||||
}
|
||||
|
||||
public function viewCountQuery()
|
||||
{
|
||||
return $this->views()->selectRaw('viewable_id, sum(views) as view_count')->groupBy('viewable_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the Tag models that have been user assigned to this entity.
|
||||
* @return \Illuminate\Database\Eloquent\Relations\MorphMany
|
||||
|
Reference in New Issue
Block a user