public function get_comments()
{
$input = $this->getinput->json(); //先接收
$query=$this->db->join('user', 'user.id = comment.user_id')->where('comment.video_id', $input['video_id'])->get('comment')->result_array();
// $query=$this->db->where('video_id', $input['video_id'])->get('comment')->result_array();
$data = array(
'data' => $query,
);
echo json_encode($data);
}
数据库:
comment表
user表