Closed wivaku closed 1 year ago
Have you figure out how to fix this issue?
no
No solution to this? I have the same problem. Always frustrating when an issue gets closed by the author with no response.
No solution to this? I have the same problem. Always frustrating when an issue gets closed by the author with no response.
This should do it?
I had a very similar issue where my data was stored in a date
column. Using ->dateAlias() fixed the issue for me. This is what should work:
Flowframe\Trend\Trend::model(Transaction::class)
->dateColumn('date') // The column with timestamp data
->dateAlias('alias') // Set an alias that doesn't conflict with any existing columns
->between(start: now()
->subMonths(1), end: now())
->perMonth()
->count()
I have a model for transactions that includes these two fields:
date
: when did the transaction take placecreated_at
: when was the record createdThis results in an error message:
Using e.g.
which "expands" to:
It seems the
date_format(...) as date
conflicts with the table columndate
.The above works fine for a model without a
date
column.Related: can the field to group by be customized? I don't want to group by
created_at
but group by the table's columndate
instead.