Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tl_estate
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hujun
tl_estate
Commits
66970bf6
Commit
66970bf6
authored
Oct 11, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
汇总导出修改
parent
daed6b77
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
Finance.php
application/index/controller/Finance.php
+1
-1
ExportExcelUntil.php
application/index/untils/ExportExcelUntil.php
+4
-2
No files found.
application/index/controller/Finance.php
View file @
66970bf6
...
@@ -1527,7 +1527,7 @@ class Finance extends Basic
...
@@ -1527,7 +1527,7 @@ class Finance extends Basic
$export
=
new
ExportExcelUntil
();
$export
=
new
ExportExcelUntil
();
$title
=
[
'收佣日期/开票日期'
,
'成交日期/开票日期'
,
'所属部门/门店'
,
'业务员'
,
'应分佣金(元)'
,
'手续费(元)'
,
'现金奖(元)'
,
'慈善基金(元)'
,
'实收佣金(元)'
,
'税费(元)'
,
'最终实收(元)'
];
$title
=
[
'收佣日期/开票日期'
,
'成交日期/开票日期'
,
'所属部门/门店'
,
'业务员'
,
'应分佣金(元)'
,
'手续费(元)'
,
'现金奖(元)'
,
'慈善基金(元)'
,
'实收佣金(元)'
,
'税费(元)'
,
'最终实收(元)'
];
$export
->
exportTable
(
'分佣提成汇总表'
,
$excel_data
,
1
1
,
'分佣提成汇总表'
,
$title
);
$export
->
exportTable
(
'分佣提成汇总表'
,
$excel_data
,
1
0
,
'分佣提成汇总表'
,
$title
);
}
else
{
}
else
{
$data
[
'code'
]
=
101
;
$data
[
'code'
]
=
101
;
$data
[
'msg'
]
=
'内部错误'
.
$result_data
[
'msg'
];
$data
[
'msg'
]
=
'内部错误'
.
$result_data
[
'msg'
];
...
...
application/index/untils/ExportExcelUntil.php
View file @
66970bf6
...
@@ -23,7 +23,7 @@ class ExportExcelUntil
...
@@ -23,7 +23,7 @@ class ExportExcelUntil
public
function
exportTable
(
string
$file_name
,
array
$data
,
int
$field_num
,
$table_title
=
""
,
array
$title
=
[])
{
public
function
exportTable
(
string
$file_name
,
array
$data
,
int
$field_num
,
$table_title
=
""
,
array
$title
=
[])
{
$filename
=
$file_name
.
'-'
.
date
(
'YmdHis'
)
.
".xlsx"
;
$filename
=
$file_name
.
'-'
.
date
(
'YmdHis'
)
.
".xlsx"
;
//设置 header,用于浏览器下载
//设置 header,用于浏览器下载
header
(
'Content-disposition: attachment; filename="'
.
$filename
.
'"'
);
header
(
'Content-disposition: attachment; filename="'
.
\XLSXWriter
::
sanitize_filename
(
$filename
)
.
'"'
);
header
(
"Content-Type: application/vnd.openXmlFormats-officeDocument.spreadSheetMl.sheet"
);
header
(
"Content-Type: application/vnd.openXmlFormats-officeDocument.spreadSheetMl.sheet"
);
header
(
'Content-Transfer-Encoding: binary'
);
header
(
'Content-Transfer-Encoding: binary'
);
header
(
'Cache-Control: must-revaLiDate'
);
header
(
'Cache-Control: must-revaLiDate'
);
...
@@ -37,9 +37,11 @@ class ExportExcelUntil
...
@@ -37,9 +37,11 @@ class ExportExcelUntil
foreach
(
$data
as
$k
=>
$v
)
{
foreach
(
$data
as
$k
=>
$v
)
{
$row_data
=
array_values
(
$v
);
$row_data
=
array_values
(
$v
);
$class_xls
->
writeSheetRow
(
'Sheet1'
,
$row_data
);
$class_xls
->
writeSheetRow
(
'Sheet1'
,
$row_data
,
[
'height'
=>
16
]
);
}
}
$class_xls
->
writeSheet
([],
'Sheet2'
);
$class_xls
->
writeSheet
([]
,
'Sheet3'
);
$class_xls
->
markMergedCell
(
'Sheet1'
,
$start_row
=
0
,
$start_col
=
0
,
$end_row
=
0
,
$end_col
=
$field_num
);
$class_xls
->
markMergedCell
(
'Sheet1'
,
$start_row
=
0
,
$start_col
=
0
,
$end_row
=
0
,
$end_col
=
$field_num
);
$class_xls
->
writeToStdOut
();
$class_xls
->
writeToStdOut
();
return
;
return
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment