list ($table_list, $prd_total) = $this->_make_item($list);
function _make_item ($list) {
$ret = array();
$prd_total = 0;
foreach ($list as $idx=>$item) {
$_item['PRD_DATE'] = $item->PRD_DATE;
if ( isset ($item->SEQ)) {
$_item['SEQ'] = $item->SEQ;
} else {
$_item['SEQ'] = '-';
}
$_item['PRD_QTY'] = $item->PRD_QTY;
$_item['LOSS_QTY'] = $item->LOSS_QTY;
$suyul = round($_item['PRD_QTY'] / ($_item['PRD_QTY'] + $_item['LOSS_QTY']) * 100, 2);
$_item['SUYUL'] = round($suyul, 2);
array_push($ret, $_item );
$prd_total += $item->PRD_QTY;
}
return array($ret, $prd_total);
}