From ce3e9ffd111dfdca9835777699fcf2dcc9e95122 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 12 Dec 2015 21:20:20 +0100 Subject: [PATCH] Better cache control. --- app/Http/Controllers/Chart/ReportController.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/Http/Controllers/Chart/ReportController.php b/app/Http/Controllers/Chart/ReportController.php index 659be0fa76..14482cda59 100644 --- a/app/Http/Controllers/Chart/ReportController.php +++ b/app/Http/Controllers/Chart/ReportController.php @@ -49,6 +49,7 @@ class ReportController extends Controller $cache = new CacheProperties; $cache->addProperty('yearInOut'); $cache->addProperty($start); + $cache->addProperty($accounts); $cache->addProperty($end); if ($cache->has()) { return Response::json($cache->get()); // @codeCoverageIgnore @@ -61,6 +62,7 @@ class ReportController extends Controller // total income and total expenses: $incomeSum = $query->incomeInPeriodCorrectedForList($start, $month, $accounts)->sum('amount_positive'); $expenseSum = $query->expenseInPeriodCorrectedForList($start, $month, $accounts)->sum('amount_positive'); + $entries->push([clone $start, $incomeSum, $expenseSum]); $start->addMonth();