Code cleanup.

This commit is contained in:
James Cole
2014-11-17 07:33:18 +01:00
parent 82c9a75578
commit 314abbea8b
39 changed files with 593 additions and 558 deletions

View File

@@ -481,12 +481,9 @@ class GoogleChartController extends BaseController
$chart->addColumn('Balance', 'number');
$sum = 0;
$set = \DB::table('piggybank_events')
->where('piggybank_id',$piggybank->id)
->groupBy('date')
->get(['date',DB::Raw('SUM(`amount`) AS `sum`')]);
$set = \DB::table('piggybank_events')->where('piggybank_id', $piggybank->id)->groupBy('date')->get(['date', DB::Raw('SUM(`amount`) AS `sum`')]);
foreach($set as $entry) {
foreach ($set as $entry) {
$chart->addRow(new Carbon($entry->date), floatval($entry->sum));
}