Open simonelepore opened 1 week ago
I can confirm the same issue here.
I also discovered something else.. if you use Trend::query (to chain where's etc., instead of Trend::model) while you have both a created_at and date column (and 'strict' property to false), the results of the trend will be completely messed up 😅
plus, I discovered that it is generally not a good idea to turn that property to false
In two of my projects I've had the same issue. If I have a table with both a 'date' column and the default 'created_at' column, the Trend query will not work. I think it's because the alias 'date' that is internally used in the query conflicts with the actual other 'date' column (when it performs a group by and order by 'date').
In fact, if I change name to the 'date' column to something else, it will work. Or if I set the mysql 'strict' property to false in database.php
Is there a way to fix this? thank you!