【发布时间】:2015-06-17 08:16:28
【问题描述】:
我正在使用 codeigniter 框架。如何在页脚的采购订单列中获取总计。
$return_array[] = array(
'brand_name'=>$row->brand_name,
'product_type'=>$row->product_type,
'product_flavour'=>$row->product_flavour,
'dealer_price'=>$dealer_price,
'price'=>$price ,
'openStock'=>$openStock,
'total_purchase'=>$toatal_purchase,
'free_issuese_in'=>$free_issuese_in,
'stock_tra_in'=>$stock_tra_in,
'tot'=> number_format(count($openStock) > 0 ? $openStock[0]->openStock:0,2)+($toatal_purchase[0]->totalPurchase)+($free_issuese_in[0]->freeIssueseIn)+($stock_tra_in[0]->stocktrain),//total
'totalsales'=>$totalSales,
'stockTraOut'=>$stockTraOut,
'freeIssuesOut'=>$freeIssuesOut,
'clossing_blnc'=> number_format(count($stockTraOut)> 0 ? $stockTraOut[0]->stockTraOut :0,2)+( $freeIssuesOut[0]->freeIssuesOut)+($totalSales[0]->totalsales)-(number_format(count($openStock) > 0 ? $openStock[0]->openStock:0,2)+($toatal_purchase[0]->totalPurchase)+($free_issuese_in[0]->freeIssueseIn)+($stock_tra_in[0]->stocktrain))//closing balance
);
我传递给 body 的那些数据......这里 7 列是总购买列。我想为页脚另一个 id 获取该列数据的总和。我使用 json 解析传递这些数据。
for( var x=0; x<order.length;x++) {
order_detail.push(
'<tr>'
+'<td>'+ order[x].brand_name + '</td>'
+'<td>'+ order[x].product_type + '</td>'
+'<td>'+ order[x].product_flavour +'</td>'
+'<td id="mm">' + order[x].dealer_price[0].dealer_price +'</td>'
+'<td id="yy" style="display:none;">' + order[x].price[0].price+'</td>'
+'<td>' + order[x].openStock[0].openStock +'</td>'
+'<td>' + order[x].total_purchase[0].totalPurchase+'</td>'
+'<td>'+ order[x].free_issuese_in[0].freeIssueseIn + '</td>'
+'<td>'+ order[x].stock_tra_in[0].stocktrain + '</td>'
+'<td>' + order[x].tot+'</td>'
+'<td>' + order[x].totalsales[0].totalsales+'</td>'
+'<td>'+ order[x].stockTraOut[0].stockTraOut + '</td>'
+'<td>'+ order[x].freeIssuesOut[0].freeIssuesOut + '</td>'
+'<td>'+ order[x].clossing_blnc + '</td>'
+'</tr>'
);
}
sweetAlert("Good job!", "monthly stock Succsessfully filter !", "success");
// $j('#lbl_rescount').text('0');
// $j('#sl_amount').text(order['totals_td'][0].tot_purchase);
// $j('#sl_amount').html(tot1);
$j('#order_body').html(order_detail);
【问题讨论】:
-
你的问题不清楚
-
我想在采购订单列中获取总数.....在表页脚中......如何编码......在数组函数内的模型文件中我无法计算总购买量....
标签: php json codeigniter