Fix controller for #718

This commit is contained in:
James Cole
2017-07-26 16:40:14 +02:00
parent b3bb8c386f
commit 0f8a66609a

View File

@@ -306,7 +306,7 @@ class AccountController extends Controller
$collector->setRange($start, $end); $collector->setRange($start, $end);
} }
$journals = $collector->getPaginatedJournals(); $journals = $collector->getPaginatedJournals();
$journals->setPath('accounts/show/' . $account->id . '/' . $moment); $journals->setPath(route('accounts.show',[$account->id, $moment]));
$count = $journals->getCollection()->count(); $count = $journals->getCollection()->count();
if ($count === 0 && $loop < 3) { if ($count === 0 && $loop < 3) {
$start->subDay(); $start->subDay();
@@ -421,7 +421,7 @@ class AccountController extends Controller
$start = $repository->oldestJournalDate($account); $start = $repository->oldestJournalDate($account);
$range = Preferences::get('viewRange', '1M')->data; $range = Preferences::get('viewRange', '1M')->data;
$start = Navigation::startOfPeriod($start, $range); $start = Navigation::startOfPeriod($start, $range);
$end = Navigation::endOfX(new Carbon, $range); $end = Navigation::endOfX(new Carbon, $range, null);
$entries = new Collection; $entries = new Collection;
// properties for cache // properties for cache