laravel 不能groupBy

Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'matter.matter_matters.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by (SQL: select * from matter_matters where status = 1 and is_top = 1 group by uid)

打开laravel 数据库的配置
strict=false
即可

你可能感兴趣的:(laravel 不能groupBy)