mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-16 09:22:33 +00:00
Fixed sort commands [skip ci]
This commit is contained in:
@@ -40,7 +40,7 @@ class Bill
|
|||||||
*/
|
*/
|
||||||
public function getBills()
|
public function getBills()
|
||||||
{
|
{
|
||||||
$this->bills->sortBy(
|
$set = $this->bills->sortBy(
|
||||||
function (BillLine $bill) {
|
function (BillLine $bill) {
|
||||||
$active = intval($bill->getBill()->active) == 0 ? 1 : 0;
|
$active = intval($bill->getBill()->active) == 0 ? 1 : 0;
|
||||||
$name = $bill->getBill()->name;
|
$name = $bill->getBill()->name;
|
||||||
@@ -50,7 +50,7 @@ class Bill
|
|||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
return $this->bills;
|
return $set;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -54,14 +54,14 @@ class Category
|
|||||||
*/
|
*/
|
||||||
public function getCategories()
|
public function getCategories()
|
||||||
{
|
{
|
||||||
$this->categories->sortByDesc(
|
$set = $this->categories->sortByDesc(
|
||||||
function (CategoryModel $category) {
|
function (CategoryModel $category) {
|
||||||
return $category->spent;
|
return $category->spent;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
return $this->categories;
|
return $set;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -66,13 +66,13 @@ class Expense
|
|||||||
*/
|
*/
|
||||||
public function getExpenses()
|
public function getExpenses()
|
||||||
{
|
{
|
||||||
$this->expenses->sortByDesc(
|
$set = $this->expenses->sortByDesc(
|
||||||
function (stdClass $object) {
|
function (stdClass $object) {
|
||||||
return $object->amount;
|
return $object->amount;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
return $this->expenses;
|
return $set;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -67,13 +67,13 @@ class Income
|
|||||||
*/
|
*/
|
||||||
public function getIncomes()
|
public function getIncomes()
|
||||||
{
|
{
|
||||||
$this->incomes->sortByDesc(
|
$set = $this->incomes->sortByDesc(
|
||||||
function (stdClass $object) {
|
function (stdClass $object) {
|
||||||
return $object->amount;
|
return $object->amount;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
return $this->incomes;
|
return $set;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -68,7 +68,7 @@ class AccountRepository implements AccountRepositoryInterface
|
|||||||
['accountmeta' => function (HasMany $query) {
|
['accountmeta' => function (HasMany $query) {
|
||||||
$query->where('name', 'accountRole');
|
$query->where('name', 'accountRole');
|
||||||
}]
|
}]
|
||||||
)->accountTypeIn($types)->orderBy('accounts.name', 'ASC')->get(['accounts.*'])->sortBy('name');
|
)->accountTypeIn($types)->orderBy('accounts.name', 'ASC')->get(['accounts.*']);
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
@@ -91,7 +91,7 @@ class BillRepository implements BillRepositoryInterface
|
|||||||
public function getBills()
|
public function getBills()
|
||||||
{
|
{
|
||||||
/** @var Collection $set */
|
/** @var Collection $set */
|
||||||
$set = Auth::user()->bills()->orderBy('name', 'ASC')->get()->sortBy('name');
|
$set = Auth::user()->bills()->orderBy('name', 'ASC')->get();
|
||||||
|
|
||||||
return $set;
|
return $set;
|
||||||
}
|
}
|
||||||
|
@@ -63,7 +63,6 @@ class BudgetRepository extends ComponentRepository implements BudgetRepositoryIn
|
|||||||
public function getActiveBudgets()
|
public function getActiveBudgets()
|
||||||
{
|
{
|
||||||
$budgets = Auth::user()->budgets()->where('active', 1)->get();
|
$budgets = Auth::user()->budgets()->where('active', 1)->get();
|
||||||
$budgets->sortBy('name');
|
|
||||||
|
|
||||||
return $budgets;
|
return $budgets;
|
||||||
}
|
}
|
||||||
|
@@ -127,8 +127,7 @@ class Search implements SearchInterface
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
$filtered = $set->merge($decrypted);
|
$filtered = $set->merge($decrypted);
|
||||||
|
$filtered = $filtered->sortBy(
|
||||||
$filtered->sortBy(
|
|
||||||
function (TransactionJournal $journal) {
|
function (TransactionJournal $journal) {
|
||||||
return intval($journal->date->format('U'));
|
return intval($journal->date->format('U'));
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user