与CodeIgniter中的GROUP_CONCAT回应的多行数据总和

**enter image description here**

I have a data set generated with CodeIgniter using MySQL. I need to get Total Delivered Qty in the view page. For that I used the following code.

 <?php $delivered_qty_total += $row->quantity; endforeach; ?>
 <?php endif; ?>

But it did not give the accurate total of the Delivered Qty. I am passing data with GROUP_CONCAT with SEPARATOR "<br />".When I am using tbl_order_products.quantity instead of GROUP_CONCAT it give me the accurate total. but I need it with GROUP_CONCAT.

'GROUP_CONCAT(tbl_order_products.quantity SEPARATOR "<br />" ) as quantity ',

Add this to your query:

SUM(tbl_order_product.quantity) AS quantity_total

See this demo for a example of how I see this working for you.