Committed bad code.

This commit is contained in:
James Cole
2016-12-23 17:51:33 +01:00
parent e15932fe4a
commit 017b1a481a

View File

@@ -163,9 +163,7 @@ class TransactionJournalSupport extends Model
if ($cache->has()) { if ($cache->has()) {
return $cache->get(); return $cache->get();
} }
$transactions = $journal->transactions() $transactions = $journal->transactions()->where('amount', '>', 0)->orderBy('transactions.account_id')->with('account')->get();
->whereNull('transactions.deleted_at')
->where('transactions.amount', '>', 0)->orderBy('transactions.account_id')->with('account')->get();
$list = new Collection; $list = new Collection;
/** @var Transaction $t */ /** @var Transaction $t */
foreach ($transactions as $t) { foreach ($transactions as $t) {
@@ -257,10 +255,7 @@ class TransactionJournalSupport extends Model
if ($cache->has()) { if ($cache->has()) {
return $cache->get(); return $cache->get();
} }
$transactions = $journal->transactions() $transactions = $journal->transactions()->where('amount', '<', 0)->orderBy('transactions.account_id')->with('account')->get();
->whereNull('transactions.deleted_at')
->where('transactions.amount', '<', 0)
->orderBy('transactions.account_id')->with('account')->get();
$list = new Collection; $list = new Collection;
/** @var Transaction $t */ /** @var Transaction $t */
foreach ($transactions as $t) { foreach ($transactions as $t) {