fix filemanager date ordering
add order by type
This commit is contained in:
parent
7ba417a03e
commit
7ca8a4aa04
|
@ -301,14 +301,16 @@ class FsFileManager
|
||||||
|
|
||||||
protected function applySort(Finder $finder, string $sort, string $direction)
|
protected function applySort(Finder $finder, string $sort, string $direction)
|
||||||
{
|
{
|
||||||
if ('name' === $sort) {
|
$sorts = [
|
||||||
$finder->sortByName();
|
'name' => 'sortByName',
|
||||||
} elseif ('updated_date' === $sort) {
|
'type' => 'sortByType',
|
||||||
$finder->sortByModifiedTime();
|
'updated_at' => 'sortByModifiedTime',
|
||||||
}
|
];
|
||||||
|
|
||||||
if ('desc' === $direction) {
|
if ('desc' === $direction) {
|
||||||
$finder->reverseSorting();
|
$finder->{$sorts[$sort]}()->reverseSorting();
|
||||||
|
} else {
|
||||||
|
$finder->{$sorts[$sort]}();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
<select v-model="sort" class="form-control form-control-sm d-inline w-auto ml-1">
|
<select v-model="sort" class="form-control form-control-sm d-inline w-auto ml-1">
|
||||||
<option value="name">Name</option>
|
<option value="name">Name</option>
|
||||||
<option value="updated_at">Date</option>
|
<option value="updated_at">Date</option>
|
||||||
|
<option value="type">Type</option>
|
||||||
</select>
|
</select>
|
||||||
<select v-model="sortDirection" class="form-control form-control-sm d-inline w-auto ml-1">
|
<select v-model="sortDirection" class="form-control form-control-sm d-inline w-auto ml-1">
|
||||||
<option value="asc">ASC</option>
|
<option value="asc">ASC</option>
|
||||||
|
|
Loading…
Reference in a new issue