聚合结算单导出优化2

master
chenzhi 5 years ago
parent ce4c938080
commit 2fc38b25b6

@ -262,13 +262,6 @@ class AggregateFinanceStatementController extends ThinkController
$this->display();
}
//导出
// public function export(){
// if(!isset($_REQUEST['ids'])) $this->error("参数错误");
// $ids = explode(",",$_REQUEST['ids']);
// foreach ($ids as $k => $v) {
// $this->doexport($v);
// }
// }
public function export()
{
if(!isset($_REQUEST['id'])) $this->error("参数错误");
@ -300,12 +293,12 @@ class AggregateFinanceStatementController extends ThinkController
$objReader = \PHPExcel_IOFactory::createReader('Excel5');
//设置模板文件
$objPHPExcel = $objReader->load("Public/Admin/excel/down_stream.xls");
$objPHPExcel = $objReader->load("Public/Admin/excel/aggregate_stream.xls");
$statement_begin_time = date('Y.m.d', $data['begintime']);//对账开始时间
$statement_end_time = date('Y.m.d',$data['endtime']);//对账截止时间
$objPHPExcel->getActiveSheet()->setCellValue('A1', "《 {$data['channel_name']} 》结算单
{$statement_begin_time}-{$statement_end_time}");
{$statement_begin_time}-{$statement_end_time}");
if ($data['withdraw_type'] == '2') {
$objPHPExcel->getActiveSheet()->setCellValue('D2','补点比例');
@ -322,9 +315,15 @@ class AggregateFinanceStatementController extends ThinkController
$objPHPExcel->getActiveSheet()->setCellValue('D'.$line, $value['ratio'] . '%');
$objPHPExcel->getActiveSheet()->setCellValue('E'.$line, $value['fax_ratio'] . '%');
$objPHPExcel->getActiveSheet()->setCellValue('C'.$line, $value['money']);
$objPHPExcel->getActiveSheet()->setCellValue('B'.$line, $product_name);
$objPHPExcel->getActiveSheet()->setCellValue('F'.$line, $value['ratio_money']);
$objPHPExcel->getActiveSheet()->getStyle('A'.$line)->getFont()->setBold(false);
$objPHPExcel->getActiveSheet()->getStyle('B'.$line)->getFont()->setBold(false);
$objPHPExcel->getActiveSheet()->getStyle('C'.$line)->getFont()->setBold(false);
$objPHPExcel->getActiveSheet()->getStyle('D'.$line)->getFont()->setBold(false);
$objPHPExcel->getActiveSheet()->getStyle('E'.$line)->getFont()->setBold(false);
$objPHPExcel->getActiveSheet()->getStyle('F'.$line)->getFont()->setBold(false);
$line++;
}

Loading…
Cancel
Save