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
630af18f
Commit
630af18f
authored
Mar 22, 2018
by
zw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
业绩
parent
a4a5360c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
2 deletions
+55
-2
Performance.php
application/api_broker/controller/Performance.php
+10
-2
PerformanceService.php
application/api_broker/service/PerformanceService.php
+45
-0
No files found.
application/api_broker/controller/Performance.php
View file @
630af18f
<?php
namespace
app\api_broker\controller
;
use
app\api_broker\extend\Basic
;
use
app\api_broker\service\PerformanceService
;
use
think\Request
;
/**
...
...
@@ -12,16 +13,23 @@ use think\Request;
*/
class
Performance
extends
Basic
{
private
$service_
;
function
__construct
(
Request
$request
=
null
)
{
parent
::
__construct
(
$request
);
$this
->
service_
=
new
PerformanceService
();
}
public
function
selectPerformanceByTime
(){
$params
=
$this
->
params
;
$params
=
array
(
"agent_id"
=>
1
,
"agent_id"
=>
1
,
"agent_id"
=>
1
,
"type"
=>
1
,
//1表示个人业绩排行 2门店 3区域
);
if
(
!
isset
(
$params
[
"agent_id"
])
||
!
isset
(
$params
[
"type"
])){
return
$this
->
response
(
"101"
,
"请求参数错误"
);
}
$this
->
service_
->
totalAgent
(
$params
[
"agent_id"
],
$params
[
"type"
]);
}
}
application/api_broker/service/PerformanceService.php
0 → 100644
View file @
630af18f
<?php
namespace
app\api_broker\service
;
use
app\model\TAgentTotalModel
;
/**
* Created by PhpStorm.
* User : zw
* Date : 2018/3/22
* Time : 上午10:37
* Intro:
*/
class
PerformanceService
{
private
$totalModel
;
public
function
__construct
()
{
$this
->
totalModel
=
new
TAgentTotalModel
();
}
public
function
totalAgent
(
$agent_id
,
$type
)
{
$where_
=
[];
$yesterday
=
date
(
"Y-m-d"
,
strtotime
(
"-1 day"
));
$end_day
=
date
(
"Y-m-d"
,
strtotime
(
"-7 day"
));
$where_
[
'total_time'
]
=
array
(
'between'
,
array
(
$yesterday
,
$end_day
)
);
switch
(
$type
){
case
1
:
break
;
case
2
:
break
;
case
3
:
break
;
default
:
}
}
}
\ No newline at end of file
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