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
03bb8642
Commit
03bb8642
authored
Mar 22, 2018
by
zw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
业绩
parent
5426666b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
12 deletions
+39
-12
PerformanceService.php
application/api_broker/service/PerformanceService.php
+5
-12
TAgentTotalModel.php
application/model/TAgentTotalModel.php
+29
-0
route.php
application/route.php
+5
-0
No files found.
application/api_broker/service/PerformanceService.php
View file @
03bb8642
...
@@ -27,18 +27,10 @@ class PerformanceService
...
@@ -27,18 +27,10 @@ class PerformanceService
$yesterday
=
date
(
"Y-m-d"
,
strtotime
(
"-1 day"
));
$yesterday
=
date
(
"Y-m-d"
,
strtotime
(
"-1 day"
));
$end_day
=
date
(
"Y-m-d"
,
strtotime
(
"-7 day"
));
$end_day
=
date
(
"Y-m-d"
,
strtotime
(
"-7 day"
));
$where_
[
'total_time'
]
=
array
(
'between'
,
array
(
$yesterday
,
$end_day
)
);
$where_
[
'total_time'
]
=
array
(
'between'
,
array
(
$end_day
,
$yesterday
,)
);
//$where_['agent_id'] = $agent_id;
switch
(
$type
){
$result
=
$this
->
totalModel
->
getTotalByAgentId
(
$where_
,
$type
);
case
1
:
dump
(
$result
);
break
;
case
2
:
break
;
case
3
:
break
;
default
:
}
}
}
}
}
\ No newline at end of file
application/model/TAgentTotalModel.php
View file @
03bb8642
...
@@ -39,6 +39,7 @@ class TAgentTotalModel extends Model{
...
@@ -39,6 +39,7 @@ class TAgentTotalModel extends Model{
}
}
/**
/**
* 获取最后统计的时间
* @param $field
* @param $field
* @param $param
* @param $param
* @return false|\PDOStatement|string|\think\Collection
* @return false|\PDOStatement|string|\think\Collection
...
@@ -51,4 +52,31 @@ class TAgentTotalModel extends Model{
...
@@ -51,4 +52,31 @@ class TAgentTotalModel extends Model{
->
limit
(
1
)
->
limit
(
1
)
->
select
();
->
select
();
}
}
public
function
getTotalByAgentId
(
$params
,
$type
){
$group_
=
""
;
switch
(
$type
){
case
1
:
$group_
=
"agent_id"
;
break
;
case
2
:
$group_
=
"store_id"
;
break
;
case
3
:
$group_
=
"district_id"
;
break
;
default
:
$group_
=
"agent_id"
;
}
$result
=
$this
->
db_
->
field
(
"agent_id,store_id,district_id,sum(performance) as performance_total"
)
->
where
(
$params
)
->
group
(
$group_
)
->
order
(
"performance_total desc"
)
->
select
();
//echo $this->db_->getLastSql();
return
$result
;
}
}
}
\ No newline at end of file
application/route.php
View file @
03bb8642
...
@@ -350,6 +350,10 @@ Route::group('broker', [
...
@@ -350,6 +350,10 @@ Route::group('broker', [
'delHouseFile'
=>
[
'api_broker/shop/delHouseFile'
,
[
'method'
=>
'post'
]],
//商铺文件删除
'delHouseFile'
=>
[
'api_broker/shop/delHouseFile'
,
[
'method'
=>
'post'
]],
//商铺文件删除
'selectPerformanceByTime'
=>
[
'api_broker/Performance/selectPerformanceByTime'
,
[
'method'
=>
'get'
]],
]);
]);
//Route::miss('api/index/miss');//处理错误的url
//Route::miss('api/index/miss');//处理错误的url
\ 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