mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-09 03:08:09 +00:00
Match methods
This commit is contained in:
@@ -242,6 +242,9 @@ class Piggybank extends Ardent
|
|||||||
{
|
{
|
||||||
$query = $this->piggybankrepetitions()
|
$query = $this->piggybankrepetitions()
|
||||||
->where(
|
->where(
|
||||||
|
function ($q) use ($date) {
|
||||||
|
|
||||||
|
$q->where(
|
||||||
function ($q) use ($date) {
|
function ($q) use ($date) {
|
||||||
$q->whereNull('startdate');
|
$q->whereNull('startdate');
|
||||||
$q->orWhere('startdate', '<=', $date->format('Y-m-d'));
|
$q->orWhere('startdate', '<=', $date->format('Y-m-d'));
|
||||||
@@ -253,6 +256,13 @@ class Piggybank extends Ardent
|
|||||||
$q->orWhere('targetdate', '>=', $date->format('Y-m-d'));
|
$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();
|
$result = $query->first();
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
|
|||||||
Reference in New Issue
Block a user