Various layout updates and tiny upgrade fixes [skip ci]

This commit is contained in:
James Cole
2016-09-16 13:29:56 +02:00
parent c123e1044a
commit aac0c9ab98
7 changed files with 32 additions and 11 deletions

View File

@@ -173,6 +173,22 @@ class BillRepository implements BillRepositoryInterface
*/
public function getBillsForAccounts(Collection $accounts): Collection
{
$fields = ['bills.id',
'bills.created_at',
'bills.updated_at',
'bills.deleted_at',
'bills.user_id',
'bills.name',
'bills.match',
'bills.amount_min',
'bills.amount_max',
'bills.date',
'bills.repeat_freq',
'bills.skip',
'bills.automatch',
'bills.active',
'bills.name_encrypted',
'bills.match_encrypted'];
$ids = $accounts->pluck('id')->toArray();
$set = $this->user->bills()
->leftJoin(
@@ -187,8 +203,8 @@ class BillRepository implements BillRepositoryInterface
)
->whereIn('transactions.account_id', $ids)
->whereNull('transaction_journals.deleted_at')
->groupBy('bills.id')
->get(['bills.*']);
->groupBy($fields)
->get($fields);
$set = $set->sortBy(
function (Bill $bill) {