diff --git a/Application/Admin/Controller/AggregateFinanceStatementController.class.php b/Application/Admin/Controller/AggregateFinanceStatementController.class.php index 275a1e453..1d1d73bfd 100644 --- a/Application/Admin/Controller/AggregateFinanceStatementController.class.php +++ b/Application/Admin/Controller/AggregateFinanceStatementController.class.php @@ -644,7 +644,30 @@ class AggregateFinanceStatementController extends ThinkController $data['pay_company'] = $data['first_party_info']; } $this->doAddOperationLog($id,"导出"); - $this->excelDownStreamTemplate($data,$big_pay_money); + $relation = M("company_relation","tab_")->where("(first_company_id={$data['channel_id']} and first_company_type=3) or (second_company_id = {$data['channel_id']} and second_company_type=3)")->find(); + + $company_type = 0; + $company_info = []; + + if ($relation['first_company_type'] == 3) { + $company_info = json_decode($relation['first_company_info'],true); + } elseif($relation['second_company_type'] == 3) { + $company_info = json_decode($relation['second_company_info'],true); + } + + if ($company_info['company_type']=='个人') { + $company_type = 1; + } elseif($company_info['company_type']=='公司') { + $company_type = 2; + } + + if ($company_type == 1) { + $this->excelDownStreamPersonTemplate($data,$big_pay_money); + } else { + $this->excelDownStreamTemplate($data,$big_pay_money); + } + + } public function excelDownStreamTemplate($data,$big_all_sum_money) { @@ -757,7 +780,7 @@ class AggregateFinanceStatementController extends ThinkController $objPHPExcel = new \PHPExcel(); $objReader = \PHPExcel_IOFactory::createReader('Excel5'); //设置模板文件 - $objPHPExcel = $objReader->load("Public/Admin/excel/aggregate_stream.xls"); + $objPHPExcel = $objReader->load("Public/Admin/excel/aggregate_person_stream.xls"); $statement_begin_time = date('Y.m.d', $data['begintime']);//对账开始时间 $statement_end_time = date('Y.m.d',$data['endtime']);//对账截止时间 diff --git a/Public/Admin/excel/aggregate_person_stream.xls b/Public/Admin/excel/aggregate_person_stream.xls new file mode 100644 index 000000000..b56405e21 Binary files /dev/null and b/Public/Admin/excel/aggregate_person_stream.xls differ