请帮助我如何才能仅获得活动.activity_id = response.activity_id的响应?这是我的CI_model
public function get_response(){
$this->db->select('*');
$this->db->from('response');
$id = $this->session->userdata('id');
$this->db->where_in('response.user_id', $id);
$this->db->join('activities', 'response.activity_id = activities.activity_id');
$this->db->join('users', 'users.id = response.user_id');
$result = $this->db->get()->result_array();
return $result;
}
1条答案
按热度按时间dwbf0jvd1#
请尝试以下操作:
您需要将别名添加到表中,以便构建更加简化和有序的查询,在本例中,别名为a、b和c。
**UPDATE:**我修复了在复制代码时错误编写get方法。
查看此处共享的查询片段:https://extendsclass.com/mysql/526c246
我希望能有所帮助