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
a1f4bb89
Commit
a1f4bb89
authored
Jun 24, 2019
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
ebcef3c2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
171 additions
and
0 deletions
+171
-0
OfficePerformance.php
application/index/controller/OfficePerformance.php
+167
-0
OfficePerformanceInfo.php
application/index/controller/OfficePerformanceInfo.php
+0
-0
route.php
application/route.php
+4
-0
No files found.
application/index/controller/OfficePerformance.php
0 → 100644
View file @
a1f4bb89
<?php
namespace
app\index\controller
;
/**
* Created by PhpStorm.
* User: zhuwei
* Date: 2018/7/31
* Time: 上午10:18
*/
use
app\index\extend\Basic
;
use
app\index\service\PerformanceService
;
use
app\index\untils\ExportExcelUntil
;
use
think\Request
;
use
\think\Session
;
class
OfficePerformance
extends
Basic
{
private
$service_
;
private
$pageSize
;
function
__construct
(
Request
$request
=
null
)
{
parent
::
__construct
(
$request
);
$this
->
service_
=
new
PerformanceService
();
$this
->
pageSize
=
20
;
}
/**
* 区域业绩排行
*/
public
function
selectDistrictPerformance
()
{
header
(
'Access-Control-Allow-Origin:*'
);
$params
=
$this
->
params
;
/*$params = array(
"type" => 3, //1表示个人业绩排行 2门店 3区域
"end_day" => "",
"start_day" =>"",
);*/
$checkResult
=
$this
->
validate
(
$params
,
"PerformanceServiceValidate.selectStorePerformance"
);
if
(
true
!==
$checkResult
)
{
return
$this
->
response
(
101
,
$checkResult
);
}
$params
[
"type"
]
=
3
;
$pageNo
=
empty
(
$this
->
params
[
'pageNo'
])
?
1
:
$this
->
params
[
'pageNo'
];
$pageSize
=
empty
(
$this
->
params
[
'pageSize'
])
?
15
:
$this
->
params
[
'pageSize'
];
//默认排序一周 2018-07-18改为本月
$start_day
=
!
empty
(
$params
[
"start_day"
])
?
$params
[
"start_day"
]
:
date
(
"Y-m-01"
,
time
());
$end_day
=
!
empty
(
$params
[
"end_day"
])
?
$params
[
"end_day"
]
:
date
(
"Y-m-d"
,
time
());
$father_id
=
!
empty
(
$params
[
"father_id"
])
?
$params
[
"father_id"
]
:
''
;
//判断是否是导出EXCEL
$is_excel
=
!
empty
(
$params
[
"is_excel"
])
?
$params
[
"is_excel"
]
:
''
;
if
(
$is_excel
==
1
){
$list
=
$this
->
service_
->
totalAgentExcel
(
$params
[
"type"
],
$end_day
,
$start_day
,
$father_id
,
$params
);
}
$list
=
$this
->
service_
->
totalAgent
(
$params
[
"type"
],
$end_day
,
$start_day
,
$pageNo
,
$pageSize
,
$father_id
,
$params
);
//dump($list);
if
(
count
(
$list
)
>
0
)
{
$result
[
"list"
]
=
$list
[
'list'
];
$result
[
"total"
]
=
$list
[
'total'
];
$result
[
"performance_total"
]
=
$list
[
'performance_total'
];
$result
[
"start_time"
]
=
$start_day
;
$result
[
"end_time"
]
=
$end_day
;
return
$this
->
response
(
"200"
,
"request success"
,
$result
);
}
return
$this
->
response
(
"200"
,
"request null"
);
}
/**
* 门店排行
*/
public
function
selectStorePerformance
()
{
header
(
'Access-Control-Allow-Origin:*'
);
$params
=
$this
->
params
;
/*$params = array(
"start_day" => '2018-08-08',
"end_day" => '2018-08-08',
);*/
$checkResult
=
$this
->
validate
(
$params
,
"PerformanceServiceValidate.selectStorePerformance"
);
if
(
true
!==
$checkResult
)
{
return
$this
->
response
(
101
,
$checkResult
);
}
$params
[
"type"
]
=
2
;
$pageNo
=
empty
(
$this
->
params
[
'pageNo'
])
?
1
:
$this
->
params
[
'pageNo'
];
$pageSize
=
empty
(
$this
->
params
[
'pageSize'
])
?
15
:
$this
->
params
[
'pageSize'
];
//默认排序一周 2018-07-18改为本月
$end_day
=
!
empty
(
$params
[
"end_day"
])
?
$params
[
"end_day"
]
:
date
(
"Y-m-d"
,
time
());
$start_day
=
!
empty
(
$params
[
"start_day"
])
?
$params
[
"start_day"
]
:
date
(
"Y-m-01"
,
time
());
$father_id
=
!
empty
(
$params
[
"father_id"
])
?
$params
[
"father_id"
]
:
''
;
//判断是否是导出EXCEL
$is_excel
=
!
empty
(
$params
[
"is_excel"
])
?
$params
[
"is_excel"
]
:
''
;
if
(
$is_excel
==
1
){
$list
=
$this
->
service_
->
totalAgentExcel
(
$params
[
"type"
],
$end_day
,
$start_day
,
$father_id
,
$params
);
}
$list
=
$this
->
service_
->
totalAgent
(
$params
[
"type"
],
$end_day
,
$start_day
,
$pageNo
,
$pageSize
,
$father_id
,
$params
);
if
(
count
(
$list
)
>
0
)
{
$result
[
"list"
]
=
$list
[
'list'
];
$result
[
"total"
]
=
$list
[
'total'
];
$result
[
"performance_total"
]
=
$list
[
'performance_total'
];
$result
[
"start_time"
]
=
$start_day
;
$result
[
"end_time"
]
=
$end_day
;
return
$this
->
response
(
"200"
,
"request success"
,
$result
);
}
return
$this
->
response
(
"200"
,
"request null"
);
}
/**
* 个人业绩排行
*/
public
function
selectIndividualPerformance
()
{
header
(
'Access-Control-Allow-Origin:*'
);
$params
=
$this
->
params
;
/* $params = array(
"type" => 1, //1表示个人业绩排行 2门店 3区域
"end_day" => "",
"start_day" => "",
);*/
$checkResult
=
$this
->
validate
(
$params
,
"PerformanceServiceValidate.selectStorePerformance"
);
if
(
true
!==
$checkResult
)
{
return
$this
->
response
(
101
,
$checkResult
);
}
$params
[
"type"
]
=
1
;
$pageNo
=
empty
(
$this
->
params
[
'pageNo'
])
?
1
:
$this
->
params
[
'pageNo'
];
$pageSize
=
empty
(
$this
->
params
[
'pageSize'
])
?
15
:
$this
->
params
[
'pageSize'
];
//默认排序一周 2018-07-18改为本月
$end_day
=
!
empty
(
$params
[
"end_day"
])
?
$params
[
"end_day"
]
:
date
(
"Y-m-d"
,
time
());
$start_day
=
!
empty
(
$params
[
"start_day"
])
?
$params
[
"start_day"
]
:
date
(
"Y-m-01"
,
time
());
$father_id
=
!
empty
(
$params
[
"father_id"
])
?
$params
[
"father_id"
]
:
''
;
//判断是否是导出EXCEL
$is_excel
=
!
empty
(
$params
[
"is_excel"
])
?
$params
[
"is_excel"
]
:
''
;
if
(
$is_excel
==
1
){
$list
=
$this
->
service_
->
totalAgentExcel
(
$params
[
"type"
],
$end_day
,
$start_day
,
$father_id
,
$params
);
}
$list
=
$this
->
service_
->
totalAgent
(
$params
[
"type"
],
$end_day
,
$start_day
,
$pageNo
,
$pageSize
,
$father_id
,
$params
);
//dump($list);
if
(
count
(
$list
)
>
0
)
{
$result
[
"list"
]
=
$list
[
'list'
];
$result
[
"total"
]
=
$list
[
'total'
];
$result
[
"performance_total"
]
=
$list
[
'performance_total'
];
$result
[
"start_time"
]
=
$start_day
;
$result
[
"end_time"
]
=
$end_day
;
return
$this
->
response
(
"200"
,
"request success"
,
$result
);
}
return
$this
->
response
(
"200"
,
"request null"
);
}
}
\ No newline at end of file
application/index/controller/OfficePerformanceInfo.php
0 → 100644
View file @
a1f4bb89
This diff is collapsed.
Click to expand it.
application/route.php
View file @
a1f4bb89
...
...
@@ -1105,6 +1105,10 @@ Route::group('office_index', [
'partialCommissionList'
=>
[
'index/OfficeFinance/partialCommissionList'
,
[
'method'
=>
'get'
]],
//分佣提成明细表
'performanceInfo'
=>
[
'index/OfficePerformanceInfo/performanceInfo'
,
[
'method'
=>
'GET|POST'
]
],
//业绩明细办公楼
'selectDistrictPerformance'
=>
[
'index/OfficePerformance/selectDistrictPerformance'
,
[
'method'
=>
'GET|POST'
]
],
//区域业绩排行
'selectStorePerformance'
=>
[
'index/OfficePerformance/selectStorePerformance'
,
[
'method'
=>
'GET|POST'
]
],
//门店排行
'selectIndividualPerformance'
=>
[
'index/OfficePerformance/selectIndividualPerformance'
,
[
'method'
=>
'GET|POST'
]
],
//个人业绩排行
]);
Route
::
group
(
'office_api'
,
[
...
...
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