Better cache control.

This commit is contained in:
James Cole 2015-12-12 21:20:20 +01:00
parent 3ada260e0e
commit ce3e9ffd11

View File

@ -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
@ -62,6 +63,7 @@ class ReportController extends Controller
$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();
}