制作销售网站有哪些问题,WordPress简单百度站长插件,凡客诚品现在还有吗,上海营销网站设计我有两个模型#xff1a;帖子和喜欢有一对多的关系(所以,一个帖子有很多喜欢). Likings模型还有一个isActive字段,表示喜欢是主动还是被动.我想获得(排序)前5个帖子,这些帖子已经收到了最大的“活跃”喜欢(只有喜欢其isActive字段为true的帖子才会被考虑).这是查询#xff1a…我有两个模型帖子和喜欢有一对多的关系(所以,一个帖子有很多喜欢). Likings模型还有一个isActive字段,表示喜欢是主动还是被动.我想获得(排序)前5个帖子,这些帖子已经收到了最大的“活跃”喜欢(只有喜欢其isActive字段为true的帖子才会被考虑).这是查询select posts.*, count(likings.id) as likes_count from postsleft join likings on likings.post_id posts.id and likings.isActive 1group by posts.idorder by likes_count desclimit 5这是由这个laravel查询产生的Post::selectRaw(posts.*, count(likes.id) as likes_count)-leftJoin(likes, function ($join) {$join-on(likes.post_id, , posts.id)-where(likes.is_active, , 1);})-groupBy(posts.id)-orderBy(likes_count, desc)-take(5)-get();这是错误SQLSTATE[42000]: Syntax error or access violation: 1055database.posts.user_id isnt in GROUP BY这里,posts.user_id也是posts表的一个字段,并显示帖子的所有者.我该如何解决这个错误似乎改变mysql配置(可能删除ONLY_FULL_GROUP_BY模式)是不合逻辑的,但查询中的变化最小.