以前的版本都是直接返回一个答案的,现在的新版本显示的是问题列表,如何修改呢?看了以前的程序直接复制过去不行~~这是以前版本返回答案的
foreach ($search_result AS $key => $val)
{
if ($this->model('search')->is_hight_similar($input_message['content'], $val['question_content']))
{
if ($val['best_answer'])
{
if ($answer_list = $this->model('answer')->get_answer_by_id($val['best_answer']))
{
$response_message = $answer_list['answer_content'];
}
}
else
{
if ($answer_list = $this->model('answer')->get_answer_list_by_question_id($val['question_id'], 1, null, 'agree_count DESC'))
{
$response_message = $answer_list[0]['answer_content'];
}
}
}
else if (!$answer_list)
{
$response_message .= "\n" . '• <a href="' . get_js_url('/m/question/' . $val['question_id']) . '">' . $val['question_content'] . '</a>' . "\n";
}
}
阅读全文
收起全文