我正在生成发票生成应用程序。在那,我有一个表,其中存储带有买方和invoice_no标志的发票的各个项目。这些标志帮助我从行中获取聚合发票构造。这是功能:
public function invoice_get()
{
    $data=array();
    $this->db->group_by('invoice_no');
    $this->db->order_by('invoice_no','asc');
    $Q=$this->db->get('sales');
    echo $Q->num_rows();
    if($Q->num_rows()>0)
    {
        foreach($Q->result_array() as $row)
        {
            if(!isset($data[$row['invoice_no']]))
            {
                $data[$row['invoice_no']]['date']=$row['date'];
                $this->db->where('id',$row['buyer']);
                $q=$this->db->get('ledgers');
                $data[$row['invoice_no']]['buyer']=$q->row();
            }
            else
            {
                $this->db->where('id',$row['item_id']);
                $i=$this->db->get('inventory');
                $data[$row['invoice_no']]['items'][$row['item_id']]=$i->row();
            }
        }
        print_r($data);
        //$this->response($data);
    }
}
问题是我没有得到项目详细信息可能是什么错误?