You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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!
The text was updated successfully, but these errors were encountered:
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!
The text was updated successfully, but these errors were encountered: