调用关注问题的人后台加个数据查询显示限制吧,有些帖子上千人回了查询起来太利害,数据查询有待优化


public function get_focus_users_action()
{
$focus_users = array();

if ($focus_users_info = $this->model('question')->get_focus_users_by_question($_GET['question_id']))
{
$question_info = $this->model('question')->get_question_info_by_id($_GET['question_id']);//为什么不直接定在main.php文件直接调用而写在ajax.php文件里又要去查询问题表,这个查询不是重复了吗?

foreach($focus_users_info as $key => $val)
{
if ($val['uid'] == $question_info['published_uid'] and $question_info['anonymous'] == 1)
{
$focus_users[$key] = array(
'uid' => 0,
'user_name' => AWS_APP::lang()->_t('匿名用户'),
'avatar_file' => get_avatar_url(0, 'mid'),
);
}
else
{
$focus_users[$key] = array(
'uid' => $val['uid'],
'user_name' => $val['user_name'],
'avatar_file' => get_avatar_url($val['uid'], 'mid'),
'url' => get_js_url('/people/' . $val['url_token'])
);
}
}
}

H::ajax_json_output($focus_users);
}


$question_info = $this->model('question')->get_question_info_by_id($_GET['question_id']);//为什么不直接定在main.php文件直接调用而写在ajax.php文件里又要去查询问题表,这个查询不是重复了吗?
已邀请:
因为这是个公用接口,的确是没加上数量限制,谢谢反馈!

该问题目前已经被锁定, 无法添加新回复