表中的所有数据都没有来?

时间:2019-04-10 17:41:44

标签: mysql codeigniter-3

public function `get_all_enquirylist`() {
    $this->db->select('`tbl_enquiry`.*, `tbl_users`.user_name as 
    user_name,states.state as state,cities.city as city, 
    group_concat(tbl_comments.comment SEPARATOR "*") as comment');
    $this->db->join('tbl_users','tbl_enquiry.alloted_agentid = 
    tbl_users.user_id','left');
    $this->db->join('states','tbl_enquiry.state = states.id','left');
    $this->db->join('cities','tbl_enquiry.city = cities.id','left');
    $this->db->join('tbl_comments','tbl_enquiry.enquiry_id = 
    tbl_comments.enquiry_id','left');
    $this->db->group_by('tbl_comments.enquiry_id');
    $this->db->from('tbl_enquiry'); 
    return $this->db->get()->result_array();
}

这是代码,我正在尝试从4个表中获取数据,以及与该查询有关的注释。我无法找到为什么没有显示某些数据?

0 个答案:

没有答案