我试图用表格中显示的数据解决问题(见图) https://i.stack.imgur.com/iCvy3.png
我想要做的是将3列文本替换为6列总和 和4列tex将被6列和替换。
我写的代码就是这个。我错过了什么?
$this->load->library('datatables');
$this->datatables
->select("DATE_FORMAT({$this->db->dbprefix('payments')}.date, '%Y-%m-%d %T') as date, " . $this->db->dbprefix('payments') . ".reference_no as payment_ref, " . $this->db->dbprefix('sales') . ".reference_no as sale_ref, " . $this->db->dbprefix('purchases') . ".reference_no as purchase_ref, paid_by, amount, type, {$this->db->dbprefix('payments')}.id as id")
->from('payments')
->join('sales', 'payments.sale_id=sales.id', 'left')
->join('purchases', 'payments.purchase_id=purchases.id', 'left')
->group_by('payments.id');