Mar cleanup.

This commit is contained in:
James Cole
2014-11-22 08:21:10 +01:00
parent 10b969a074
commit ddf9f52737
3 changed files with 17 additions and 32 deletions

View File

@@ -196,6 +196,18 @@ class AccountController extends BaseController
break;
}
$accounts->each(
function (Account $account) {
$transaction = $account->transactions()->orderBy('updated_at', 'DESC')->first();
if (is_null($transaction)) {
$account->lastActionDate = null;
}
$account->lastActionDate = $transaction->updated_at;
}
);
return View::make('accounts.index', compact('what', 'subTitleIcon', 'subTitle', 'accounts'));
}