mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Fix broken query "created_at_before" and "updated_at_before"
This commit is contained in:
parent
7b830a69d9
commit
0fea3a5a85
@ -555,7 +555,9 @@ trait TimeCollection
|
|||||||
*/
|
*/
|
||||||
public function setObjectBefore(Carbon $date, string $field): GroupCollectorInterface
|
public function setObjectBefore(Carbon $date, string $field): GroupCollectorInterface
|
||||||
{
|
{
|
||||||
die('a');
|
$afterStr = $date->format('Y-m-d 00:00:00');
|
||||||
|
$this->query->where(sprintf('transaction_journals.%s', $field), '<=', $afterStr);
|
||||||
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1374,7 +1374,7 @@ class OperatorQuerySearch implements SearchInterface
|
|||||||
foreach ($range as $key => $value) {
|
foreach ($range as $key => $value) {
|
||||||
switch ($key) {
|
switch ($key) {
|
||||||
default:
|
default:
|
||||||
throw new FireflyException(sprintf('Cannot handle key "%s" in setDateAfterParams()', $key));
|
throw new FireflyException(sprintf('Cannot handle key "%s" in setObjectDateBeforeParams()', $key));
|
||||||
case 'exact':
|
case 'exact':
|
||||||
$this->collector->setObjectBefore($value, $field);
|
$this->collector->setObjectBefore($value, $field);
|
||||||
$this->operators->push(['type' => sprintf('%s_before', $field), 'value' => $value->format('Y-m-d'),]);
|
$this->operators->push(['type' => sprintf('%s_before', $field), 'value' => $value->format('Y-m-d'),]);
|
||||||
@ -1413,7 +1413,7 @@ class OperatorQuerySearch implements SearchInterface
|
|||||||
foreach ($range as $key => $value) {
|
foreach ($range as $key => $value) {
|
||||||
switch ($key) {
|
switch ($key) {
|
||||||
default:
|
default:
|
||||||
throw new FireflyException(sprintf('Cannot handle key "%s" in setDateAfterParams()', $key));
|
throw new FireflyException(sprintf('Cannot handle key "%s" in setObjectDateAfterParams()', $key));
|
||||||
case 'exact':
|
case 'exact':
|
||||||
$this->collector->setObjectAfter($value, $field);
|
$this->collector->setObjectAfter($value, $field);
|
||||||
$this->operators->push(['type' => sprintf('%s_after', $field), 'value' => $value->format('Y-m-d'),]);
|
$this->operators->push(['type' => sprintf('%s_after', $field), 'value' => $value->format('Y-m-d'),]);
|
||||||
|
Loading…
Reference in New Issue
Block a user