Filter ignores `useColumn`
underdpt opened this issue · 0 comments
underdpt commented
Hi,
I have a complex query on a table, on which I would like to use DateRangeFilter
. Due to the complexity, I have to specify the table and column to be used on the filter. This is my code:
DateRangeFilter::make('created_at')
->useColumn('articulos.created_at')
->label('Fecha de alta'),
There, useColumn
is ignored and it generates a query like:
select count(*) as aggregate
from `articulos`
where (
`articulos`.`deleted_at` is null
and `created_at` between '2023-05-01 00:00:00' and '2023-05-31 23:59:59'
)
instead of
select count(*) as aggregate
from `articulos`
where (
`articulos`.`deleted_at` is null
and `articulos`. `created_at` between '2023-05-01 00:00:00' and '2023-05-31 23:59:59'
)
It would also be good to allow the developer to modify the query, like the included filters on Filament.
Thanks!