Remove various sort routines.

This commit is contained in:
James Cole
2019-05-04 20:58:43 +02:00
parent d5c5fa4fad
commit 8676764513
19 changed files with 261 additions and 151 deletions

View File

@@ -311,13 +311,6 @@ class CurrencyController extends Controller
$pageSize = (int)app('preferences')->get('listPageSize', 50)->data;
$collection = $this->repository->getAll();
$total = $collection->count();
$collection = $collection->sortBy(
function (TransactionCurrency $currency) {
$intEnabled = $currency->enabled ? 0 : 1;
return $intEnabled . $currency->name;
}
);
$collection = $collection->slice(($page - 1) * $pageSize, $pageSize);
$currencies = new LengthAwarePaginator($collection, $total, $pageSize, $page);
$currencies->setPath(route('currencies.index'));