Bring date only from current year + previous year in the filter.

This commit is contained in:
Djonathan 2022-07-08 16:21:44 -03:00
parent ae5faf377a
commit e5f8f254dd
2 changed files with 2 additions and 2 deletions

View File

@ -34,7 +34,7 @@ class FilterItem extends EntityJson
/** /**
* @var string * @var string
*/ */
protected string $interval; protected string $interval = '';
/** /**
* @return bool * @return bool

View File

@ -63,7 +63,7 @@ class FilterType
$fType = 'not like'; $fType = 'not like';
} }
if ($filter->getInterval()) if (!empty($filter->getInterval()))
{ {
$filter->setField("TO_DATE({$filter->getField()}, 'YYMM')"); $filter->setField("TO_DATE({$filter->getField()}, 'YYMM')");
$filter->setValue(DB::raw("TO_DATE(TO_CHAR(current_date , 'YYYY-01-01'), 'YYYY-MM-DD') - INTERVAL $filter->setValue(DB::raw("TO_DATE(TO_CHAR(current_date , 'YYYY-01-01'), 'YYYY-MM-DD') - INTERVAL