1
I have the following appointment:
$this->db->select('tbl_supplier.supplier_name, tbl_order_details.*');
$this->db->join("tbl_supplier", "tbl_supplier.supplier_id=tbl_order_details.supplier_id");
$this->db->where('tbl_order_details.order_id', $id);
$this->db->get('tbl_order_details')->result();
My return in SQL is as follows:
SELECT `tbl_supplier`.`supplier_name`, `tbl_order_details`.*
FROM (`tbl_order_details`)
JOIN `tbl_supplier` ON `tbl_supplier`.`supplier_id`=`tbl_order_details`.`supplier_id`
WHERE `tbl_order_details`.`order_id` = '6'
And in the database returns me the following:
It works as it should, however, I need that in this listing I can group by product and add quantity and sub_total.
BS: I may have different products in this listing, not necessarily a single type.
Expected result:
Dell i5 Notebook | 15 units | Total R$ 20,464.29