Skip to content
Permalink
Browse files

调整

  • Loading branch information
WangNingkai committed Jun 30, 2019
1 parent 3224ddd commit 1f44f14c22f6619733e5fa066269f8b514199441
Showing with 4 additions and 8 deletions.
  1. +4 −8 app/Http/Controllers/IndexController.php
@@ -187,15 +187,11 @@ public function list(Request $request)
});
if (strtolower($sortBy) !== 'desc') {
$folders = $folders->sortBy($field)->toArray();
$files = $files->sortBy($field)->toArray();
usort($folders, 'strnatcmp');
usort($files, 'strnatcmp');
$folders = $folders->sortBy($field, $field === 'name' ? SORT_NATURAL : SORT_REGULAR)->toArray();
$files = $files->sortBy($field, $field === 'name' ? SORT_NATURAL : SORT_REGULAR)->toArray();
} else {
$folders = $folders->sortByDesc($field)->toArray();
$files = $files->sortByDesc($field)->toArray();
usort($folders, 'strnatcmp');
usort($files, 'strnatcmp');
$folders = $folders->sortByDesc($field, $field === 'name' ? SORT_NATURAL : SORT_REGULAR)->toArray();
$files = $files->sortByDesc($field, $field === 'name' ? SORT_NATURAL : SORT_REGULAR)->toArray();
}
$originItems = collect($folders)->merge($files)->toArray();

0 comments on commit 1f44f14

Please sign in to comment.
You can’t perform that action at this time.