From f73a9033b30cde8c5dc96050e78909eb88206a2d Mon Sep 17 00:00:00 2001 From: chenzhi Date: Thu, 3 Sep 2020 09:53:26 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E4=B8=8B=E6=B8=B8?= =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E6=AF=94=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/Common/extend.php | 5 ++-- .../CompanyStatementPoolController.class.php | 28 +++++------------- Public/Admin/excel/down_stream.xls | Bin 26624 -> 26624 bytes 3 files changed, 10 insertions(+), 23 deletions(-) diff --git a/Application/Admin/Common/extend.php b/Application/Admin/Common/extend.php index 0a9b2e21d..9b944d44e 100644 --- a/Application/Admin/Common/extend.php +++ b/Application/Admin/Common/extend.php @@ -2166,9 +2166,10 @@ function excelDownStreamTemplate($data, $all_sum_money, $all_pay_amount, $big_al } 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($value['increment_ratio'] == 0){ $value['increment_ratio'] = 0; diff --git a/Application/Admin/Controller/CompanyStatementPoolController.class.php b/Application/Admin/Controller/CompanyStatementPoolController.class.php index 34a6fa726..6b8c6daea 100644 --- a/Application/Admin/Controller/CompanyStatementPoolController.class.php +++ b/Application/Admin/Controller/CompanyStatementPoolController.class.php @@ -241,7 +241,7 @@ class CompanyStatementPoolController extends ThinkController } $cline = $line+1; if($is_export){ - $v['statement_money'] = "="; + $v['statement_money'] = "=ROUND("; } $row = 0; @@ -261,44 +261,30 @@ class CompanyStatementPoolController 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}+"; }else{ $count['platform_amount'] += $val['pay_amount']; $count['sum_money'] += $val['sum_money']; } } - // if($is_export){ - // //J3*(K3+L3)+M3-N3 - // if($va['statement_type'] > 0){ //罚款服务器费用 - // $va['sum_money'] = "=J{$line}"; - // }else{ - // $va['sum_money'] = "=J{$line}*(K{$line}+L{$line})+M{$line}-N{$line}"; - // } - // }else{ - // $count['platform_amount'] += $va['pay_amount']; - // $count['sum_money'] += $va['sum_money']; - // } } $v['row'] = $row; if($is_export){ - if($v['withdraw_type'] != 3) { - $v['statement_money'] .="O{$cline}-P{$cline}"; + $v['statement_money'] .="O{$cline}-P{$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/Public/Admin/excel/down_stream.xls b/Public/Admin/excel/down_stream.xls index a8539a39d424c040e78dcfb0f96a69afd2d9569a..80c58286374190d8e6516ddf80b6c08a2bb097b9 100644 GIT binary patch delta 1276 zcmZWpU1%It6h3Emc6WBu-R#WH&dhGM&5A!H;3iuY!6NYoV-oGA+NMon64}^T`=d~N zQYlRkQ3~pVM~Dv=`cSkGENLd-lj|Y`d{9g!h$2dmJV>bzN(v$^>vv~1Tg17XbI&>V z`_4J{hgn$Xg>_zjS&v;98EtGY$gBF>8XuN_^lRxb@&mV4{)+ylH)hTb%8#*eapRs6 zCaJ}Lmp6@qOeczR+VEuEsK{`_mUk1L*oi(FHhSbW*hbR(0O9L^T`+99n0P=+NlU&@ z6lB$K{QHtyk$9Pw$tIS~RMD(ZA5}1>sh9TXdAcI`bdgu&!Spfq<$U@$ulljhPnc8k zS;pn8tYwB^r%abkx!dfA{fh01ZF%yR>G5tkAH=@JdS1$%E@zaMEz^^aO)sA&q8rT& z(FQ#Ovx}%v+C(!YnX%k37kKZrZBM?i+qFCA>{#p|JrS@h`6EE0GudTZ(wB|p z-5u-()nFEODs)LT>vBPLE^}E+-p|HRZ!Oy^b+A%9tW_B5)4PHSDftDgaPQbPc6!sc z*p&mw0v=Yvb#(?~rWN0No0a{4&U*viucqQ57xXQ=pB*XZhLTZS3KLGID93V-8p^SV z9+u0w({kByWWSS?0jEdKItEVuJLeHZE4ZS0$Aw;Wy2Wv)E%cezy1a#jDap~Vhv z$WI6F=c|6|P?h-!e`@Sgo*xVn*Hxov_sP~6qG5{BElMIrG!p30V|t1-#6nMl7ioJD zczWB@>1m3#y(sNR#*nA@Rdh{MpGOG|=||~+nza~o1n;UI#C3X>4kC#vrpg>516rXX z;EVy4hNaQrU>s>7RSV;kfL1&m$O+6S2DA?JWH3VX%J??(jNF(QDZiv18bCIsKsnwT zC+H|f9Pte39C#<`l$@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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);