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
a61c63be
Commit
a61c63be
authored
Nov 23, 2018
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
业绩日报周报重写
parent
4948c360
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
7 deletions
+51
-7
Statement.php
application/api_broker/controller/Statement.php
+46
-7
StatementService.php
application/api_broker/service/StatementService.php
+0
-0
route.php
application/route.php
+5
-0
No files found.
application/api_broker/controller/Statement.php
View file @
a61c63be
...
...
@@ -4,6 +4,7 @@ namespace app\api_broker\controller;
use
app\api_broker\extend\Basic
;
use
app\api_broker\service\StatementService
;
use
app\model\AAgents
;
use
app\model\RAgentNote
;
use
app\model\RAgentReport
;
use
think\Exception
;
...
...
@@ -37,11 +38,17 @@ class Statement extends Basic
header
(
'Access-Control-Allow-Origin:*'
);
$params
=
$this
->
params
;
Log
::
write
(
$params
,
'zhuwei'
);
//记录日志
/*$params = array(
"agent_id" => 3742,//5739 总监 5740店长
"time_start" => date("Y-m-d", time()),
"time_end" => date("Y-m-d", time()),
);*/
$params
=
array
(
'agent_id'
=>
'5739'
,
'time_start'
=>
'2018-11-23'
,
'time_end'
=>
'2018-11-23'
,
);
if
(
!
isset
(
$params
[
"agent_id"
])
||
!
isset
(
$params
[
"time_start"
])
||
!
isset
(
$params
[
"time_end"
]))
{
return
$this
->
response
(
"101"
,
"请求参数错误"
);
...
...
@@ -208,20 +215,52 @@ class Statement extends Basic
header
(
'Access-Control-Allow-Origin:*'
);
$params
=
$this
->
params
;
/*$params = array(
"agent_id" => 3742,//5739 总监 5740店长
"time_start" => date("Y-m-d", time()),
"time_end" => date("Y-m-d", time()),
"agent_id" => 5739,//5739 总监 5740店长
"day_or_week" => 0,//0 日报 1 周报
);*/
if
(
!
isset
(
$params
[
"agent_id"
])
||
!
isset
(
$params
[
"time_start"
])
||
!
isset
(
$params
[
"time_end"
]))
{
return
$this
->
response
(
"101"
,
"请求参数错误"
);
}
$day_or_week
=
$params
[
"time_start"
]
==
$params
[
"time_end"
]
?
'day'
:
'week'
;
$time_end
=
$params
[
"time_end"
]
.
" 23:59:59"
;
$result
=
$this
->
service_
->
selectStatementByAgentId
(
$params
[
"agent_id"
],
$params
[
"time_start"
],
$time_end
,
$day_or_week
);
#当前登录人角色 0经纪人 1店长 2总监
$field
=
"id,store_id,district_id,level,name,phone,sex,status"
;
$agentModel
=
new
AAgents
();
$agent_result
=
$agentModel
->
getAgentById
(
$field
,
[
"agent_id"
=>
$params
[
"agent_id"
]
]);
if
(
!
$agent_result
){
return
$this
->
response
(
"200"
,
"request is null"
);
}
$store_id
=
$agent_result
[
0
][
"store_id"
];
$district_id
=
$agent_result
[
0
][
"district_id"
];
if
(
$agent_result
[
0
][
"level"
]
==
10
)
{
//todo 业务员 Clerk
$agent_level
=
0
;
$result
=
$this
->
service_
->
selectStatementForClerk
(
$params
[
"agent_id"
],
$agent_level
,
$store_id
,
$district_id
);
}
elseif
(
$agent_result
[
0
][
"level"
]
==
20
)
{
//todo 1店长
$agent_level
=
1
;
if
(
$params
[
"day_or_week"
]
==
0
){
//todo 日报
}
else
{
//todo 周报
}
}
else
{
//todo 2总监
$agent_level
=
2
;
if
(
$params
[
"day_or_week"
]
==
0
){
//todo 日报
}
else
{
//todo 周报
}
}
if
(
count
(
$result
)
>
0
)
{
if
(
$result
)
{
return
$this
->
response
(
"200"
,
"request success"
,
$result
);
}
else
{
return
$this
->
response
(
"200"
,
"request is null"
);
...
...
application/api_broker/service/StatementService.php
View file @
a61c63be
This diff is collapsed.
Click to expand it.
application/route.php
View file @
a61c63be
...
...
@@ -706,6 +706,10 @@ Route::group('broker', [
'getVolume'
=>
[
'api_broker/SpreadUser/getVolume'
,
[
'method'
=>
'get'
]
],
'getHouseAddress'
=>
[
'api_broker/shop/getHouseAddress'
,
[
'method'
=>
'get'
]
]
//搜索商铺地址
//业绩日报周报重写
'dayStatement'
=>
[
'api_broker/Statement/dayStatement'
,
[
'method'
=>
'get|post'
]],
]);
//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