Change sorting on graphs so that date is in date order

This commit is contained in:
Deon George 2022-01-14 19:15:37 +11:00
parent 81b9ebfe6b
commit e78e79a8f5
1 changed files with 2 additions and 1 deletions

View File

@ -77,13 +77,14 @@ class Domain extends Model
->when($systems?->count(),function($query) use ($systems) { return $query->whereIn('fftn_id',$systems->pluck('addresses')->flatten()->pluck('id')->toArray()); })
->where('datetime','>=',Carbon::now()->subMonths(self::STATS_MONTHS)->startOfMonth())
->groupBy(['echoarea_id','echoareas.name','date'])
->orderBy('echoareas.name')
->orderBy('date')
->orderBy('echoareas.name')
->with(['echoarea'])
->get();
if ($byarea)
return $echostats
->sortBy('name')
->groupBy(['echoarea_id'])
->map(function($item,$key) {
return [