mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2024-12-31 19:27:51 -06:00
Match methods
This commit is contained in:
parent
f00dfd2859
commit
eacad20f51
@ -242,6 +242,9 @@ class Piggybank extends Ardent
|
||||
{
|
||||
$query = $this->piggybankrepetitions()
|
||||
->where(
|
||||
function ($q) use ($date) {
|
||||
|
||||
$q->where(
|
||||
function ($q) use ($date) {
|
||||
$q->whereNull('startdate');
|
||||
$q->orWhere('startdate', '<=', $date->format('Y-m-d'));
|
||||
@ -253,6 +256,13 @@ class Piggybank extends Ardent
|
||||
$q->orWhere('targetdate', '>=', $date->format('Y-m-d'));
|
||||
}
|
||||
);
|
||||
}
|
||||
)->orWhere(
|
||||
function ($q) use ($date) {
|
||||
$q->where('startdate', '>=', $date->format('Y-m-d'));
|
||||
$q->where('targetdate', '>=', $date->format('Y-m-d'));
|
||||
}
|
||||
)->orderBy('startdate', 'ASC');
|
||||
$result = $query->first();
|
||||
|
||||
return $result;
|
||||
|
Loading…
Reference in New Issue
Block a user