优化导出保留两位小数

master
chenzhi 5 years ago
parent e085b6cc78
commit bcdbb3d0a0

@ -2036,9 +2036,10 @@ function excelSpecialComplementEmplate($data, $all_sum_money, $all_pay_amount, $
} else {//游戏 } else {//游戏
$product_name = $value['game_name']; $product_name = $value['game_name'];
$objPHPExcel->getActiveSheet()->getStyle('D'.$line)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_PERCENTAGE_00); $objPHPExcel->getActiveSheet()->getStyle('D'.$line)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_PERCENTAGE);
$objPHPExcel->getActiveSheet()->getStyle('E'.$line)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_PERCENTAGE_000); $objPHPExcel->getActiveSheet()->getStyle('E'.$line)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_PERCENTAGE);
$objPHPExcel->getActiveSheet()->getStyle('C'.$line)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER_00); $objPHPExcel->getActiveSheet()->getStyle('C'.$line)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER_00);
$objPHPExcel->getActiveSheet()->getStyle('F'.$line)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER_00);
if($data['withdraw_type'] != 3) { if($data['withdraw_type'] != 3) {

@ -578,7 +578,7 @@ class CompanyStatementController extends ThinkController
$cline = $line+1; $cline = $line+1;
if($is_export){ if($is_export){
$v['statement_money'] = "="; $v['statement_money'] = "=ROUND(";
} }
$row = 0; $row = 0;
@ -598,9 +598,9 @@ class CompanyStatementController extends ThinkController
if($is_export){ if($is_export){
if($v['withdraw_type'] != 3) { if($v['withdraw_type'] != 3) {
$val['sum_money'] = "=K{$line}*(L{$line}+M{$line})"; $val['sum_money'] = "=ROUND(K{$line}*(L{$line}+M{$line}),2)";
} else { } else {
$val['sum_money'] = "=K{$line}*(M{$line})"; $val['sum_money'] = "=ROUND(K{$line}*(M{$line}),2)";
} }
// $val['sum_money'] = "=J{$line}*(K{$line}+L{$line})"; // $val['sum_money'] = "=J{$line}*(K{$line}+L{$line})";
$v['statement_money'] .= "N{$line}+"; $v['statement_money'] .= "N{$line}+";
@ -625,17 +625,17 @@ class CompanyStatementController extends ThinkController
if($is_export){ if($is_export){
if($v['withdraw_type'] != 3) { if($v['withdraw_type'] != 3) {
$v['statement_money'] .="N{$cline}-O{$cline}"; $v['statement_money'] .="N{$cline}-O{$cline},2)";
} else { } else {
$v['statement_money'] = substr($v['statement_money'],0,strlen($v['statement_money'])-1); $v['statement_money'] = substr($v['statement_money'],0,strlen($v['statement_money'])-1).",2)";
} }
// dump($v['statement_money']);die(); // dump($v['statement_money']);die();
} }
} }
if($is_export){ if($is_export){
$count["platform_amount"] = "=SUM(K2:K".$line.")"; $count["platform_amount"] = "=ROUND(SUM(K2:K".$line."),2)";
$count["sum_money"] = "=SUM(Q2:Q".$line.")"; $count["sum_money"] = "=ROUND(SUM(Q2:Q".$line."),2)";
} }
$this->assign("data",$infolist); $this->assign("data",$infolist);
$this->assign("count",$count); $this->assign("count",$count);

@ -332,9 +332,9 @@ class CompanyStatementPoolController extends ThinkController
if($is_export){ if($is_export){
if($v['withdraw_type'] != 3) { if($v['withdraw_type'] != 3) {
$va['d_statement_money'] = "=D{$line}*(1-G{$line})*(E{$line}+F{$line})"; $va['d_statement_money'] = "=ROUND(D{$line}*(1-G{$line})*(E{$line}+F{$line}),2)";
} else { } else {
$va['d_statement_money'] = "=D{$line}*(F{$line})"; $va['d_statement_money'] = "=ROUND(D{$line}*(F{$line}),2)";
} }
}else{ }else{
if ($v['withdraw_type'] != 3) { if ($v['withdraw_type'] != 3) {
@ -356,7 +356,7 @@ class CompanyStatementPoolController extends ThinkController
if($is_export){ if($is_export){
if ($v['withdraw_type'] != 3) { if ($v['withdraw_type'] != 3) {
$v['statement_money'] = "=SUM(H{$cline}:H{$line})+J{$cline}-I{$cline}"; $v['statement_money'] = "=ROUND(SUM(H{$cline}:H{$line})+J{$cline}-I{$cline},2)";
} }
@ -369,11 +369,11 @@ class CompanyStatementPoolController extends ThinkController
} }
if($is_export){ if($is_export){
$count["platform_amount"] = "=SUM(D2:D".$line.")"; $count["platform_amount"] = "=ROUND(SUM(D2:D".$line."),2)";
$count["d_statement_money"] = "=SUM(H2:H".$line.")"; $count["d_statement_money"] = "=ROUND(SUM(H2:H".$line."),2)";
$count["fine"] = "=SUM(I2:I".$line.")"; $count["fine"] = "=ROUND(SUM(I2:I".$line."),2)";
$count["reward"] = "=SUM(J2:J".$line.")"; $count["reward"] = "=ROUND(SUM(J2:J".$line."),2)";
$count["statement_money"] = "=SUM(K2:K".$line.")"; $count["statement_money"] = "=ROUND(SUM(K2:K".$line."),2)";
} }
// dd($infolist); // dd($infolist);
$this->assign("data",$infolist); $this->assign("data",$infolist);
@ -417,7 +417,7 @@ class CompanyStatementPoolController extends ThinkController
$line ++; $line ++;
$va['company_ratio'] = 100-$va['ratio']; $va['company_ratio'] = 100-$va['ratio'];
if($is_export){ if($is_export){
$va['d_statement_money'] = "=F{$line}*G{$line}"; $va['d_statement_money'] = "=ROUND(F{$line}*G{$line},2)";
}else{ }else{
$va['d_statement_money'] = round($va['pay_amount']*$va['ratio']/100,2); $va['d_statement_money'] = round($va['pay_amount']*$va['ratio']/100,2);
$count['platform_amount'] += $va['pay_amount']; $count['platform_amount'] += $va['pay_amount'];
@ -427,7 +427,7 @@ class CompanyStatementPoolController extends ThinkController
} }
$v['matche_platform'] = $Partner[$v['company_id']]; $v['matche_platform'] = $Partner[$v['company_id']];
if($is_export){ if($is_export){
$v['statement_money'] = "=SUM(K{$cline}:K{$line})+M{$cline}-L{$cline}"; $v['statement_money'] = "=ROUND(SUM(K{$cline}:K{$line})+M{$cline}-L{$cline},2)";
}else{ }else{
$count['fine'] += $v['fine']; $count['fine'] += $v['fine'];
$count['reward'] += $v['reward']; $count['reward'] += $v['reward'];
@ -437,12 +437,12 @@ class CompanyStatementPoolController extends ThinkController
} }
if($is_export){ if($is_export){
$count["d_statement_money"] = "=SUM(K3:K".$line.")"; $count["d_statement_money"] = "=ROUND(SUM(K3:K".$line."),2)";
$count["platform_amount"] = "=SUM(E3:E".$line.")"; $count["platform_amount"] = "=ROUND(SUM(E3:E".$line."),2)";
$count["platform_amount2"] = "=SUM(F3:F".$line.")"; $count["platform_amount2"] = "=ROUND(SUM(F3:F".$line."),2)";
$count["fine"] = "=SUM(L3:L".$line.")"; $count["fine"] = "=ROUND(SUM(L3:L".$line."),2)";
$count["reward"] = "=SUM(M3:M".$line.")"; $count["reward"] = "=ROUND(SUM(M3:M".$line."),2)";
$count["statement_money"] = "=SUM(N3:N".$line.")"; $count["statement_money"] = "=ROUND(SUM(N3:N".$line."),2)";
} }
// dd($infolist); // dd($infolist);
$this->assign("data",$infolist); $this->assign("data",$infolist);

Loading…
Cancel
Save