mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-09 22:26:04 +00:00
Expand API to return transaction groups.
This commit is contained in:
@@ -675,6 +675,23 @@ trait TimeCollection
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the end time of the results to return.
|
||||
*
|
||||
* @param Carbon $end
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function setEnd(Carbon $end): GroupCollectorInterface
|
||||
{
|
||||
// always got to end of day / start of day for ranges.
|
||||
$endStr = $end->format('Y-m-d 23:59:59');
|
||||
|
||||
$this->query->where('transaction_journals.date', '<=', $endStr);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Carbon $date
|
||||
* @param string $field
|
||||
@@ -822,6 +839,22 @@ trait TimeCollection
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the start time of the results to return.
|
||||
*
|
||||
* @param Carbon $start
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function setStart(Carbon $start): GroupCollectorInterface
|
||||
{
|
||||
$startStr = $start->format('Y-m-d 00:00:00');
|
||||
|
||||
$this->query->where('transaction_journals.date', '>=', $startStr);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Collect transactions updated on a specific date.
|
||||
*
|
||||
|
Reference in New Issue
Block a user