优化上游导出%

master
chenzhi 4 years ago
parent c53abd3114
commit 7ba9c25610

@ -1873,7 +1873,6 @@ function excelUpStreamTemplate($data, $all_sum_money, $all_pay_amount, $big_all_
define('EOL',(PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
date_default_timezone_set('Europe/London');
Vendor("PHPExcel.PHPExcel");
$objReader = \PHPExcel_IOFactory::createReader('Excel5');
@ -1918,6 +1917,23 @@ function excelUpStreamTemplate($data, $all_sum_money, $all_pay_amount, $big_all_
}
} else {//游戏
$product_name = $value['game_name'];
$objPHPExcel->getActiveSheet()->getStyle('F'.$line)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_PERCENTAGE_00);
$objPHPExcel->getActiveSheet()->getStyle('G'.$line)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_PERCENTAGE_00);
$objPHPExcel->getActiveSheet()->getStyle('H'.$line)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_PERCENTAGE_00);
$objPHPExcel->getActiveSheet()->getStyle('I'.$line)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_PERCENTAGE_000);
if($value['first_ratio'] == 0){
$value['first_ratio'] = 0;
}else{
$value['first_ratio'] = number_format($value['first_ratio'], 2);
}
if($value['second_ratio'] == 0) {
$value['second_ratio'] = 0;
}else{
$value['second_ratio'] = number_format($value['second_ratio'], 2);
}
if($value['promote_ratio'] == 0) $value['promote_ratio'] = 0;
if($value['fax_ratio'] == 0) $value['fax_ratio'] = 0;
$objPHPExcel->getActiveSheet()->setCellValue('F'.$line , $value['first_ratio'] . '%');
$objPHPExcel->getActiveSheet()->setCellValue('G'.$line, $value['second_ratio'] . '%');
$objPHPExcel->getActiveSheet()->setCellValue('H'.$line, $value['promote_ratio'] . '%');
@ -2015,6 +2031,24 @@ 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('C'.$line)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER_00);
if($value['increment_ratio'] == 0){
$value['increment_ratio'] = 0;
}else{
$value['increment_ratio'] = number_format($value['first_ratio'], 2);
}
if($value['ratio'] == 0) {
$value['ratio'] = 0;
}else{
$value['ratio'] = number_format($value['ratio'], 2);
}
if($value['fax_ratio'] == 0) $value['fax_ratio'] = 0;
if ($data['withdraw_type'] == 2) {
$objPHPExcel->getActiveSheet()->setCellValue('D'.$line, $value['increment_ratio'] . '%');
}else{

@ -47,6 +47,7 @@ class PHPExcel_Style_NumberFormat extends PHPExcel_Style_Supervisor implements P
const FORMAT_PERCENTAGE = '0%';
const FORMAT_PERCENTAGE_00 = '0.00%';
const FORMAT_PERCENTAGE_000 = '0.000%';
const FORMAT_DATE_YYYYMMDD2 = 'yyyy-mm-dd';
const FORMAT_DATE_YYYYMMDD = 'yy-mm-dd';

Loading…
Cancel
Save