From bcdbb3d0a042e120934e4f74e52f6f3f6986fb74 Mon Sep 17 00:00:00 2001 From: chenzhi Date: Thu, 3 Sep 2020 11:34:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=AF=BC=E5=87=BA=E4=BF=9D?= =?UTF-8?q?=E7=95=99=E4=B8=A4=E4=BD=8D=E5=B0=8F=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/Common/extend.php | 5 +-- .../CompanyStatementController.class.php | 14 ++++---- .../CompanyStatementPoolController.class.php | 32 +++++++++---------- 3 files changed, 26 insertions(+), 25 deletions(-) diff --git a/Application/Admin/Common/extend.php b/Application/Admin/Common/extend.php index 9b944d44e..39aa08532 100644 --- a/Application/Admin/Common/extend.php +++ b/Application/Admin/Common/extend.php @@ -2036,9 +2036,10 @@ function excelSpecialComplementEmplate($data, $all_sum_money, $all_pay_amount, $ } else {//游戏 $product_name = $value['game_name']; - $objPHPExcel->getActiveSheet()->getStyle('D'.$line)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_PERCENTAGE_00); - $objPHPExcel->getActiveSheet()->getStyle('E'.$line)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_PERCENTAGE_000); + $objPHPExcel->getActiveSheet()->getStyle('D'.$line)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_PERCENTAGE); + $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('F'.$line)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER_00); if($data['withdraw_type'] != 3) { diff --git a/Application/Admin/Controller/CompanyStatementController.class.php b/Application/Admin/Controller/CompanyStatementController.class.php index f0fd336da..606d55be1 100644 --- a/Application/Admin/Controller/CompanyStatementController.class.php +++ b/Application/Admin/Controller/CompanyStatementController.class.php @@ -578,7 +578,7 @@ class CompanyStatementController extends ThinkController $cline = $line+1; if($is_export){ - $v['statement_money'] = "="; + $v['statement_money'] = "=ROUND("; } $row = 0; @@ -598,9 +598,9 @@ class CompanyStatementController extends ThinkController if($is_export){ 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 { - $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})"; $v['statement_money'] .= "N{$line}+"; @@ -625,17 +625,17 @@ class CompanyStatementController extends ThinkController if($is_export){ if($v['withdraw_type'] != 3) { - $v['statement_money'] .="N{$cline}-O{$cline}"; + $v['statement_money'] .="N{$cline}-O{$cline},2)"; } 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(); } } if($is_export){ - $count["platform_amount"] = "=SUM(K2:K".$line.")"; - $count["sum_money"] = "=SUM(Q2:Q".$line.")"; + $count["platform_amount"] = "=ROUND(SUM(K2:K".$line."),2)"; + $count["sum_money"] = "=ROUND(SUM(Q2:Q".$line."),2)"; } $this->assign("data",$infolist); $this->assign("count",$count); diff --git a/Application/Admin/Controller/CompanyStatementPoolController.class.php b/Application/Admin/Controller/CompanyStatementPoolController.class.php index 6b8c6daea..184d5d23b 100644 --- a/Application/Admin/Controller/CompanyStatementPoolController.class.php +++ b/Application/Admin/Controller/CompanyStatementPoolController.class.php @@ -332,9 +332,9 @@ class CompanyStatementPoolController extends ThinkController if($is_export){ 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 { - $va['d_statement_money'] = "=D{$line}*(F{$line})"; + $va['d_statement_money'] = "=ROUND(D{$line}*(F{$line}),2)"; } }else{ if ($v['withdraw_type'] != 3) { @@ -356,7 +356,7 @@ class CompanyStatementPoolController extends ThinkController if($is_export){ 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){ - $count["platform_amount"] = "=SUM(D2:D".$line.")"; - $count["d_statement_money"] = "=SUM(H2:H".$line.")"; - $count["fine"] = "=SUM(I2:I".$line.")"; - $count["reward"] = "=SUM(J2:J".$line.")"; - $count["statement_money"] = "=SUM(K2:K".$line.")"; + $count["platform_amount"] = "=ROUND(SUM(D2:D".$line."),2)"; + $count["d_statement_money"] = "=ROUND(SUM(H2:H".$line."),2)"; + $count["fine"] = "=ROUND(SUM(I2:I".$line."),2)"; + $count["reward"] = "=ROUND(SUM(J2:J".$line."),2)"; + $count["statement_money"] = "=ROUND(SUM(K2:K".$line."),2)"; } // dd($infolist); $this->assign("data",$infolist); @@ -417,7 +417,7 @@ class CompanyStatementPoolController extends ThinkController $line ++; $va['company_ratio'] = 100-$va['ratio']; if($is_export){ - $va['d_statement_money'] = "=F{$line}*G{$line}"; + $va['d_statement_money'] = "=ROUND(F{$line}*G{$line},2)"; }else{ $va['d_statement_money'] = round($va['pay_amount']*$va['ratio']/100,2); $count['platform_amount'] += $va['pay_amount']; @@ -427,7 +427,7 @@ class CompanyStatementPoolController extends ThinkController } $v['matche_platform'] = $Partner[$v['company_id']]; 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{ $count['fine'] += $v['fine']; $count['reward'] += $v['reward']; @@ -437,12 +437,12 @@ class CompanyStatementPoolController extends ThinkController } if($is_export){ - $count["d_statement_money"] = "=SUM(K3:K".$line.")"; - $count["platform_amount"] = "=SUM(E3:E".$line.")"; - $count["platform_amount2"] = "=SUM(F3:F".$line.")"; - $count["fine"] = "=SUM(L3:L".$line.")"; - $count["reward"] = "=SUM(M3:M".$line.")"; - $count["statement_money"] = "=SUM(N3:N".$line.")"; + $count["d_statement_money"] = "=ROUND(SUM(K3:K".$line."),2)"; + $count["platform_amount"] = "=ROUND(SUM(E3:E".$line."),2)"; + $count["platform_amount2"] = "=ROUND(SUM(F3:F".$line."),2)"; + $count["fine"] = "=ROUND(SUM(L3:L".$line."),2)"; + $count["reward"] = "=ROUND(SUM(M3:M".$line."),2)"; + $count["statement_money"] = "=ROUND(SUM(N3:N".$line."),2)"; } // dd($infolist); $this->assign("data",$infolist);