Update date related code to fix several issues with SQLite

This commit is contained in:
James Cole
2018-02-04 09:22:52 +01:00
parent 36f67793cb
commit 089300d57e
6 changed files with 24 additions and 22 deletions

View File

@@ -367,8 +367,8 @@ class BillRepository implements BillRepositoryInterface
public function getYearAverage(Bill $bill, Carbon $date): string
{
$journals = $bill->transactionJournals()
->where('date', '>=', $date->year . '-01-01')
->where('date', '<=', $date->year . '-12-31')
->where('date', '>=', $date->year . '-01-01 00:00:00')
->where('date', '<=', $date->year . '-12-31 00:00:00')
->get();
$sum = '0';
$count = strval($journals->count());