|
|
|
@ -262,23 +262,25 @@ 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);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
private function doexport($id)
|
|
|
|
|
// 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("参数错误");
|
|
|
|
|
$id = $_REQUEST['id'];
|
|
|
|
|
|
|
|
|
|
$data = M("aggregate_statement","tab_")->where("id = '{$id}'")->find();
|
|
|
|
|
|
|
|
|
|
$data['first_party_info'] = json_decode($data['first_party_info'], 1);//甲方
|
|
|
|
|
$data['second_party_info'] = json_decode($data['second_party_info'], 1);//乙方
|
|
|
|
|
$data['statement_info'] = json_decode($data['statement_info'], 1);//结算记录
|
|
|
|
|
//收款方
|
|
|
|
|
$big_pay_money = convertAmountToCn($data['pay_money']);//大写
|
|
|
|
|
|
|
|
|
|
$big_pay_money = convertAmountToCn($data['ratio_money']);//大写
|
|
|
|
|
$data['receive_company'] = $data['pay_type'] ? $data['first_party_info'] : $data['second_party_info'];
|
|
|
|
|
$data['pay_company'] = $data['pay_type'] ? $data['second_party_info'] : $data['first_party_info'];
|
|
|
|
|
$this->excelDownStreamTemplate($data,$big_pay_money);
|
|
|
|
@ -353,16 +355,12 @@ class AggregateFinanceStatementController extends ThinkController
|
|
|
|
|
}else{
|
|
|
|
|
$fileName = "{$data['second_party_info']['partner']}&{$data['first_party_info']['partner']}-对账单{$statement_begin_time}-{$statement_end_time}";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// dd($fileName);
|
|
|
|
|
ob_end_clean();//清除缓冲区,避免乱码
|
|
|
|
|
header('pragma:public');
|
|
|
|
|
header('Content-type:application/vnd.ms-excel;charset=utf-8;name="' . $fileName .'".xls');
|
|
|
|
|
header("Content-Disposition:attachment;filename={$fileName}.xls");//attachment新窗口打印inline本窗口打印
|
|
|
|
|
$objWriter = \PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
|
|
|
|
|
$objWriter->save('php://output');
|
|
|
|
|
exit;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|