报错信息:
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,点击首页的热门标签报错》
发表评论