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
10c78708
Commit
10c78708
authored
May 23, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改导出分佣提成明细表
parent
fc44a179
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
11 deletions
+13
-11
Finance.php
application/index/controller/Finance.php
+10
-8
ExportExcelUntil.php
application/index/untils/ExportExcelUntil.php
+3
-3
No files found.
application/index/controller/Finance.php
View file @
10c78708
...
...
@@ -494,11 +494,11 @@ class Finance extends Basic
$where
[
'a.confirm_status'
]
=
1
;
if
(
!
empty
(
$this
->
params
[
'create_time'
])
&&
empty
(
$this
->
params
[
'end_time'
]))
{
$where
[
'a.confirm_date'
]
=
[
'> time'
,
$this
->
params
[
'create_time'
]];
$where
[
'a.confirm_date'
]
=
[
'>
=
time'
,
$this
->
params
[
'create_time'
]];
}
if
(
!
empty
(
$this
->
params
[
'end_time'
])
&&
empty
(
$this
->
params
[
'create_time'
]))
{
$where
[
'a.confirm_date'
]
=
[
'< time'
,
$this
->
params
[
'create_time'
]];
$where
[
'a.confirm_date'
]
=
[
'<
=
time'
,
$this
->
params
[
'create_time'
]];
}
if
(
!
empty
(
$this
->
params
[
'end_time'
])
&&
!
empty
(
$this
->
params
[
'create_time'
]))
{
...
...
@@ -539,17 +539,19 @@ class Finance extends Basic
public
function
exportExcel
()
{
$pageNo
=
1
;
$pageSize
=
250000
;
$where
=
[];
$where
[
'a.confirm_status'
]
=
1
;
if
(
!
empty
(
$this
->
params
[
'create_time'
])
&&
empty
(
$this
->
params
[
'end_time'
]))
{
$where
[
'a.c
reate_time'
]
=
[
'> time'
,
$this
->
params
[
'create_time'
]
.
' 00:00:00'
];
$where
[
'a.c
onfirm_date'
]
=
[
'>= time'
,
$this
->
params
[
'create_time'
]
];
}
if
(
!
empty
(
$this
->
params
[
'end_time'
])
&&
empty
(
$this
->
params
[
'create_time'
]))
{
$where
[
'a.c
reate_time'
]
=
[
'< time'
,
$this
->
params
[
'create_time'
]
.
' 23:59:59'
];
$where
[
'a.c
onfirm_date'
]
=
[
'<= time'
,
$this
->
params
[
'create_time'
]
];
}
if
(
!
empty
(
$this
->
params
[
'end_time'
])
&&
!
empty
(
$this
->
params
[
'create_time'
]))
{
$where
[
'a.c
reate_time'
]
=
[
'between time'
,
[
$this
->
params
[
'create_time'
]
.
' 00:00:00'
,
$this
->
params
[
'create_time'
]
.
' 23:59:59'
]];
$where
[
'a.c
onfirm_date'
]
=
[
'between time'
,
[
$this
->
params
[
'create_time'
],
$this
->
params
[
'create_time'
]
]];
}
if
(
!
empty
(
$this
->
params
[
'internal_address'
]))
{
...
...
@@ -568,15 +570,15 @@ class Finance extends Basic
$where
[
'b.house_number'
]
=
[
'like'
,
'%'
.
$this
->
params
[
'house_number'
]
.
'%'
];
}
$where
=
[];
$field
=
'a.id,a.create_time,a.practical_fee,b.scale_fee,d.internal_address,b.agent_id,cash,service_charge,tallAge,charity_fund,real_fee'
;
$field
=
'a.id,a.confirm_date,a.practical_fee,b.scale_fee,d.internal_address,b.agent_id,cash,service_charge,tallAge,charity_fund,real_fee'
;
$m_commission
=
new
OPartialCommission
();
$data
=
$m_commission
->
getCommissionBargainColumn
(
$pageNo
,
$pageSize
,
'a.id desc'
,
$field
,
$where
);
$export
=
new
ExportExcelUntil
();
$export
->
exportTable
(
'分佣提成明细'
,
$data
,
8
);
$title
=
[
'收佣日期'
,
'所属部门/门店'
,
'业务员'
,
'应分佣金(元)'
,
'实分佣金(元)'
,
'手续费(元)'
,
'慈善基金(元)'
,
'现金奖(元)'
,
'实收佣金(元)'
];
$export
->
exportTable
(
'分佣提成明细'
,
$data
,
8
,
'分佣提成明细表'
,
$title
);
return
;
}
...
...
application/index/untils/ExportExcelUntil.php
View file @
10c78708
...
...
@@ -16,7 +16,7 @@ class ExportExcelUntil
* @param $data
* @param $row
*/
public
function
exportTable
(
string
$file_name
,
array
$data
,
int
$row
)
{
public
function
exportTable
(
string
$file_name
,
array
$data
,
int
$row
,
$table_title
=
""
,
array
$title
=
[]
)
{
$filename
=
$file_name
.
'-'
.
date
(
'YmdHis'
)
.
".xlsx"
;
//设置 header,用于浏览器下载
header
(
'Content-disposition: attachment; filename="'
.
$filename
.
'"'
);
...
...
@@ -28,8 +28,8 @@ class ExportExcelUntil
$styles1
=
array
(
'font'
=>
'Arial'
,
'font-size'
=>
12
,
'font-style'
=>
'bold'
,
'fill'
=>
'#eee'
,
'halign'
=>
'center'
,
'border'
=>
'left,right,top,bottom'
,
'border-style'
=>
'thin'
,
'Valign'
=>
'center'
,
'height'
=>
20
);
$class_xls
->
writeSheetHeader
(
'Sheet1'
,
[
'string'
],[
'suppress_row'
=>
true
,
'widths'
=>
[
20
,
25
,
20
,
30
,
30
,
20
,
30
,
20
,
30
]]);
$class_xls
->
writeSheetRow
(
'Sheet1'
,
[
'分佣提成明细表'
],[
'height'
=>
32
,
'font-size'
=>
20
,
'font-style'
=>
'bold'
,
'halign'
=>
'center'
,
'valign'
=>
'center'
]);
$class_xls
->
writeSheetRow
(
'Sheet1'
,
[
'收佣日期'
,
'所属部门/门店'
,
'业务员'
,
'应分佣金(元)'
,
'实分佣金(元)'
,
'手续费(元)'
,
'慈善基金(元)'
,
'现金奖(元)'
,
'实收佣金(元)'
]
,
$styles1
);
$class_xls
->
writeSheetRow
(
'Sheet1'
,
[
$table_title
],[
'height'
=>
32
,
'font-size'
=>
20
,
'font-style'
=>
'bold'
,
'halign'
=>
'center'
,
'valign'
=>
'center'
]);
$class_xls
->
writeSheetRow
(
'Sheet1'
,
$title
,
$styles1
);
foreach
(
$data
as
$k
=>
$v
)
{
$row_data
=
array_values
(
$v
);
...
...
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