From c5fb734e4264a865d5d7ddecff47d4854489219c Mon Sep 17 00:00:00 2001 From: James Cole Date: Thu, 3 Mar 2016 13:24:02 +0100 Subject: [PATCH] Fix query. [skip ci] --- app/Repositories/Account/AccountRepository.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/Repositories/Account/AccountRepository.php b/app/Repositories/Account/AccountRepository.php index 7a5495e338..8f2747edd8 100644 --- a/app/Repositories/Account/AccountRepository.php +++ b/app/Repositories/Account/AccountRepository.php @@ -207,6 +207,12 @@ class AccountRepository implements AccountRepositoryInterface ->orderBy('transaction_journals.date', 'DESC') ->orderBy('transaction_journals.order', 'ASC') ->orderBy('transaction_journals.id', 'DESC') + ->where( + function (Builder $q) use ($account) { + $q->where('destination.account_id', $account->id); + $q->orWhere('source.account_id', $account->id); + } + ) ->take(10) ->get(TransactionJournal::QUERYFIELDS);