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
fa63bf67
Commit
fa63bf67
authored
Aug 16, 2018
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
业绩excel导出
parent
89c11cf5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
70 additions
and
1 deletion
+70
-1
Performance.php
application/index/controller/Performance.php
+65
-0
PerformanceService.php
application/index/service/PerformanceService.php
+3
-0
route.php
application/route.php
+2
-1
No files found.
application/index/controller/Performance.php
View file @
fa63bf67
...
@@ -8,7 +8,9 @@ namespace app\index\controller;
...
@@ -8,7 +8,9 @@ namespace app\index\controller;
*/
*/
use
app\index\extend\Basic
;
use
app\index\extend\Basic
;
use
app\index\service\PerformanceService
;
use
app\index\service\PerformanceService
;
use
app\index\untils\ExportExcelUntil
;
use
think\Request
;
use
think\Request
;
use
\think\Session
;
class
Performance
extends
Basic
class
Performance
extends
Basic
{
{
...
@@ -166,6 +168,69 @@ class Performance extends Basic
...
@@ -166,6 +168,69 @@ class Performance extends Basic
}
}
/**
* 导出分佣提成明细表
*
* @return string
*/
public
function
getPerformanceExcel
()
{
$export
=
new
ExportExcelUntil
();
$data
=
Session
::
get
(
'excelPerformance'
);
/**
* {
["agent_id"] => int(5739)
["store_id"] => int(3742)
["district_id"] => int(16)
["performance_total"] => string(8) "22231.20"
["bargain_sum_total"] => string(2) "17"
["paylog_total"] => string(1) "7"
["march_in_num_total"] => string(1) "7"
["look_at_num_total"] => string(2) "20"
["add_house_num_total"] => string(2) "63"
["add_user_num_total"] => string(2) "40"
["index_"] => int(1)
["name"] => string(10) "总测试1"
["img"] => string(82) "https://localhost/static/user_header/20180615/6528100f422ffa6f7d1cb1293c1eaaed.jpg"
["store_name"] => string(6) "大大"
["district_name"] => string(9) "测试郭"
["team_num"] => int(7)
}
*/
foreach
(
$data
[
'data'
]
as
$key
=>
$v
)
{
$e_data_old
[
'index_'
]
=
$v
[
'index_'
];
if
(
$data
[
'type'
]
==
3
){
$e_data_old
[
'name'
]
=
$v
[
'district_name'
];
}
elseif
(
$data
[
'type'
]
==
2
){
$e_data_old
[
'name'
]
=
$v
[
'store_name'
];
}
else
{
$e_data_old
[
'name'
]
=
$v
[
'name'
];
}
$e_data_old
[
'performance_total'
]
=
$v
[
'performance_total'
];
$e_data_old
[
'paylog'
]
=
$v
[
'paylog_total'
];
$e_data_old
[
'bargain_sum'
]
=
$v
[
'bargain_sum_total'
];
$e_data_old
[
'march_in_num'
]
=
$v
[
'march_in_num_total'
];
$e_data_old
[
'look_at_num'
]
=
$v
[
'look_at_num_total'
];
$e_data_old
[
'add_house_num'
]
=
$v
[
'add_house_num_total'
];
$e_data_old
[
'add_user_num'
]
=
$v
[
'add_user_num_total'
];
$e_data_old
[
'team_num'
]
=
$v
[
'team_num'
];
$e_data_new
[]
=
$e_data_old
;
}
if
(
$data
[
'type'
]
==
3
){
$title
=
[
'排名'
,
'部门'
,
'业绩(元)'
,
'成交单数'
,
'收款数'
,
'进场数'
,
'报备数'
,
'新增商铺'
,
'新增客户'
,
'团队人数'
];
}
elseif
(
$data
[
'type'
]
==
2
){
$title
=
[
'排名'
,
'门店'
,
'业绩(元)'
,
'成交单数'
,
'收款数'
,
'进场数'
,
'报备数'
,
'新增商铺'
,
'新增客户'
,
'团队人数'
];
}
else
{
$title
=
[
'排名'
,
'经纪人'
,
'业绩(元)'
,
'成交单数'
,
'收款数'
,
'进场数'
,
'报备数'
,
'新增商铺'
,
'新增客户'
,
'团队人数'
];
}
$export
->
exportTable
(
'业绩排行'
,
$e_data_new
,
10
,
'业绩排行表'
,
$title
);
return
''
;
}
...
...
application/index/service/PerformanceService.php
View file @
fa63bf67
...
@@ -8,6 +8,8 @@ use app\model\OMarchInModel;
...
@@ -8,6 +8,8 @@ use app\model\OMarchInModel;
use
app\model\OReportModel
;
use
app\model\OReportModel
;
use
app\model\TAgentTotalModel
;
use
app\model\TAgentTotalModel
;
use
app\model\Users
;
use
app\model\Users
;
use
\think\Session
;
/**
/**
* Created by PhpStorm.
* Created by PhpStorm.
...
@@ -296,6 +298,7 @@ class PerformanceService
...
@@ -296,6 +298,7 @@ class PerformanceService
}
}
}
}
//dump($arr);exit;
//dump($arr);exit;
Session
::
set
(
'excelPerformance'
,[
'data'
=>
$arr
,
'type'
=>
$type
]);
return
[
'list'
=>
$arr
,
'total'
=>
0
];
return
[
'list'
=>
$arr
,
'total'
=>
0
];
}
}
...
...
application/route.php
View file @
fa63bf67
...
@@ -290,7 +290,8 @@ Route::group('index', [
...
@@ -290,7 +290,8 @@ Route::group('index', [
'selectDistrictPerformance'
=>
[
'index/Performance/selectDistrictPerformance'
,
[
'method'
=>
'POST|GET'
]
],
//区域业绩排行 朱伟 2018-07-31
'selectDistrictPerformance'
=>
[
'index/Performance/selectDistrictPerformance'
,
[
'method'
=>
'POST|GET'
]
],
//区域业绩排行 朱伟 2018-07-31
'selectStorePerformance'
=>
[
'index/Performance/selectStorePerformance'
,
[
'method'
=>
'POST|GET'
]
],
//门店业绩排行 朱伟 2018-07-31
'selectStorePerformance'
=>
[
'index/Performance/selectStorePerformance'
,
[
'method'
=>
'POST|GET'
]
],
//门店业绩排行 朱伟 2018-07-31
'selectIndividualPerformance'
=>
[
'index/Performance/selectIndividualPerformance'
,
[
'method'
=>
'POST|GET'
]
],
//个人业绩排行 朱伟 2018-07-31
'selectIndividualPerformance'
=>
[
'index/Performance/selectIndividualPerformance'
,
[
'method'
=>
'POST|GET'
]
],
//个人业绩排行 朱伟 2018-07-31
'transformFollowUp'
=>
[
'index/HouseFollowUp/transformFollowUp'
,
[
'method'
=>
'GET'
]
],
//个人业绩排行 朱伟 2018-07-31
'transformFollowUp'
=>
[
'index/HouseFollowUp/transformFollowUp'
,
[
'method'
=>
'GET'
]
],
//个人业绩排行 朱伟 2018-07-31
'getPerformanceExcel'
=>
[
'index/Performance/getPerformanceExcel'
,
[
'method'
=>
'POST|GET'
]
],
//区域业绩排行 朱伟 2018-07-31
...
...
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