折雨的天空

新浪微薄腾讯微薄

最新碎语:最近霉到了住。哎。。。

您的位置:折雨的天空 >php开发> 本地PHP8.1配置wecenter4.1,点击首页的热门标签报错

本地PHP8.1配置wecenter4.1,点击首页的热门标签报错

报错信息:


SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'peth5.aws_answer.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

和上一个报错是一样的,SQL语法的问题,如果是调整MySQL配置的话,就不用再改这些了。


改动的方法也是一样的,修改:app/model/PostRelation.php的292行,加上查询字段。


修改为如下:


$last_answers = $sort=='hot'?Answer::getHotAnswerByIds($question_ids,"any_value(id) as id,any_value(content) as content,any_value(against_count) as against_count,any_value(agree_count) as agree_count,any_value(uid) as uid,any_value(comment_count) as comment_count,any_value(uninterested_count) as uninterested_count,any_value(thanks_count) as thanks_count,any_value(answer_user_ip) as answer_user_ip,any_value(answer_user_local) as answer_user_local,any_value(is_anonymous) as is_anonymous,any_value(publish_source) as publish_source,any_value(status) as status,any_value(is_best) as is_best,any_value(best_uid) as best_uid,any_value(best_time) as best_time,any_value(force_fold) as force_fold,any_value(search_text) as search_text,any_value(popular_value) as popular_value,any_value(popular_value_update) as popular_value_update,any_value(create_time) as create_time,any_value(update_time) as update_time,question_id"):Answer::getLastAnswerByIds($question_ids);

------------正 文 已 结 束, 感 谢 您 的 阅 读 (折雨的天空)--------------------

转载请注明本文标题和链接:《本地PHP8.1配置wecenter4.1,点击首页的热门标签报错

奖励一下

取消

分享不易,烦请有多多打赏,如您也困难,点击右边关闭即可!

扫码支持
扫码打赏,5元,10元,你说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

-秒后自动关闭,如已打赏,或者不愿打赏,请点击右上角关闭图标。

发表评论

路人甲 表情
看不清楚?点图切换