mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-11 07:10:48 +00:00
Optimize queries for statistics.
This commit is contained in:
@@ -66,4 +66,9 @@ class PeriodStatisticRepository implements PeriodStatisticRepositoryInterface
|
||||
|
||||
return $stat;
|
||||
}
|
||||
|
||||
public function allInRangeForModel(Model $model, Carbon $start, Carbon $end): Collection
|
||||
{
|
||||
return $model->primaryPeriodStatistics()->where('start','>=', $start)->where('end','<=', $end)->get();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user