mirror of
https://github.com/Kovah/LinkAce.git
synced 2025-04-21 07:22:20 +02:00
Correct random ordering for tags and lists
This commit is contained in:
parent
e64bca235f
commit
4706b1cb9a
@ -51,10 +51,15 @@ class ListController extends Controller
|
||||
$this->orderDir = $request->input('orderBy', 'desc');
|
||||
$this->checkOrdering();
|
||||
|
||||
$links = $list->links()
|
||||
->publicOnly()
|
||||
->orderBy($this->orderBy, $this->orderDir)
|
||||
->paginate(getPaginationLimit());
|
||||
$links = $list->links()->publicOnly();
|
||||
|
||||
if ($this->orderBy === 'random') {
|
||||
$links->inRandomOrder();
|
||||
} else {
|
||||
$links->orderBy($this->orderBy, $this->orderDir);
|
||||
}
|
||||
|
||||
$links = $links->paginate(getPaginationLimit());
|
||||
|
||||
return view('guest.lists.show', [
|
||||
'pageTitle' => trans('list.list') . ': ' . $list->name,
|
||||
|
@ -52,10 +52,15 @@ class TagController extends Controller
|
||||
$this->orderDir = $request->input('orderBy', 'desc');
|
||||
$this->checkOrdering();
|
||||
|
||||
$links = $tag->links()
|
||||
->publicOnly()
|
||||
->orderBy($this->orderBy, $this->orderDir)
|
||||
->paginate(getPaginationLimit());
|
||||
$links = $tag->links()->publicOnly();
|
||||
|
||||
if ($this->orderBy === 'random') {
|
||||
$links->inRandomOrder();
|
||||
} else {
|
||||
$links->orderBy($this->orderBy, $this->orderDir);
|
||||
}
|
||||
|
||||
$links = $links->paginate(getPaginationLimit());
|
||||
|
||||
return view('guest.tags.show', [
|
||||
'pageTitle' => trans('tag.tag') . ': ' . $tag->name,
|
||||
|
@ -83,10 +83,15 @@ class ListController extends Controller
|
||||
$this->orderDir = $request->input('orderBy', 'desc');
|
||||
$this->checkOrdering();
|
||||
|
||||
$links = $list->links()
|
||||
->visibleForUser()
|
||||
->orderBy($this->orderBy, $this->orderDir)
|
||||
->paginate(getPaginationLimit());
|
||||
$links = $list->links()->publicOnly();
|
||||
|
||||
if ($this->orderBy === 'random') {
|
||||
$links->inRandomOrder();
|
||||
} else {
|
||||
$links->orderBy($this->orderBy, $this->orderDir);
|
||||
}
|
||||
|
||||
$links = $links->paginate(getPaginationLimit());
|
||||
|
||||
return view('models.lists.show', [
|
||||
'pageTitle' => trans('list.list') . ': ' . $list->name,
|
||||
|
@ -86,10 +86,15 @@ class TagController extends Controller
|
||||
$this->orderDir = $request->input('orderBy', 'desc');
|
||||
$this->checkOrdering();
|
||||
|
||||
$links = $tag->links()
|
||||
->visibleForUser()
|
||||
->orderBy($this->orderBy, $this->orderDir)
|
||||
->paginate(getPaginationLimit());
|
||||
$links = $tag->links()->publicOnly();
|
||||
|
||||
if ($this->orderBy === 'random') {
|
||||
$links->inRandomOrder();
|
||||
} else {
|
||||
$links->orderBy($this->orderBy, $this->orderDir);
|
||||
}
|
||||
|
||||
$links = $links->paginate(getPaginationLimit());
|
||||
|
||||
return view('models.tags.show', [
|
||||
'pageTitle' => trans('tag.tag') . ': ' . $tag->name,
|
||||
|
Loading…
x
Reference in New Issue
Block a user