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
df5a2a32
Commit
df5a2a32
authored
Jul 19, 2018
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
业绩修改
parent
8874329e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
4 deletions
+19
-4
Statement.php
application/api_broker/controller/Statement.php
+3
-2
StatementService.php
application/api_broker/service/StatementService.php
+16
-2
No files found.
application/api_broker/controller/Statement.php
View file @
df5a2a32
...
...
@@ -35,8 +35,8 @@ class Statement extends Basic
{
header
(
'Access-Control-Allow-Origin:*'
);
$params
=
$this
->
params
;
/*
$params = array(
"agent_id" => 57
39
,
/*$params = array(
"agent_id" => 57
40
,
"time_start" => date("Y-m-d", time()),
"time_end" => date("Y-m-d", time()) . " 23:59:59",
);*/
...
...
@@ -48,6 +48,7 @@ class Statement extends Basic
$time_end
=
$params
[
"time_end"
]
.
" 23:59:59"
;
try
{
$result
=
$this
->
service_
->
selectStatementByAgentId
(
$params
[
"agent_id"
],
$params
[
"time_start"
],
$time_end
);
if
(
count
(
$result
)
>
0
)
{
return
$this
->
response
(
"200"
,
"request success"
,
$result
);
}
else
{
...
...
application/api_broker/service/StatementService.php
View file @
df5a2a32
...
...
@@ -54,7 +54,6 @@ class StatementService
$field
=
"id,store_id,district_id,level,name,phone,sex,status"
;
$agent_result
=
$this
->
agentModel
->
getAgentById
(
$field
,
[
"agent_id"
=>
$agent_id
]);
if
(
count
(
$agent_result
)
<=
0
)
{
return
null
;
}
...
...
@@ -108,7 +107,6 @@ class StatementService
if
(
!
empty
(
$params
))
{
$agentsArr
=
$this
->
agentModel
->
getAgentsByStoreId
(
$params
);
$agent_total
=
count
(
$agentsArr
);
//dump($agentsArr);
if
(
$agent_total
>
0
)
{
$agentIds
=
""
;
foreach
(
$agentsArr
as
$key
=>
$value
)
{
...
...
@@ -183,6 +181,8 @@ class StatementService
*/
private
function
getStoreList
(
$conditions
,
$agent_id
,
$agent_name
)
{
//dump($conditions);
$conditions_
=
$conditions
;
$conditions_
[
"agent_id"
]
=
$agent_id
;
//是门店 统计个人业绩
...
...
@@ -192,6 +192,19 @@ class StatementService
$store_list
[
"user_num"
]
=
$this
->
userModel
->
getAddUserNumByAgentId
(
$conditions_
);
//$store_list["follow_up_num"] = $this->followUpModel->getAddFollowUpNumByAgentId($conditions_);
$store_list
[
"follow_up_num"
]
=
$this
->
reportModel
->
getAddFollowUpNumByAgentId
(
$conditions_
);
//本周业绩
$start_time
=
date
(
"Y-m-d"
,
strtotime
(
"-7 day"
));
$end_time
=
date
(
"Y-m-d"
,
strtotime
(
"-1 day"
));
$where_
[
'create_time'
]
=
[
'between'
,
[
$start_time
.
" 00:00:00"
,
$end_time
.
" 23:59:59"
]];
$obargain
=
new
OBargainModel
();
$performanceSum
=
$obargain
->
getAddBargainNum
(
$where_
,
1
);
//1表示业绩 2表示实收
$store_list
[
"performance_week"
]
=
isset
(
$performanceSum
[
0
][
"num"
])
?
$performanceSum
[
0
][
"num"
]
:
0
;
//客源
$addUserNum
=
$this
->
userModel
->
getAddUserNum
(
$where_
);
$store_list
[
"add_user_num"
]
=
isset
(
$addUserNum
[
0
][
"num"
])
?
$addUserNum
[
0
][
"num"
]
:
0
;
return
$store_list
;
}
...
...
@@ -222,6 +235,7 @@ class StatementService
$paramArr
[
"store_id"
]
=
$value
[
"store_id"
];
$paramArr
[
"level"
]
=
array
(
"in"
,
[
20
,
40
]
);
$agentsResult
=
$this
->
agentModel
->
getAgentsByStoreId
(
$paramArr
);
//dump($agentsResult);
$results
[
$key
][
"name"
]
=
count
(
$agentsResult
)
>
0
?
$agentsResult
[
0
][
"name"
]
:
null
;
foreach
(
$result
as
$i
=>
$item
)
{
if
(
$value
[
"store_id"
]
==
$item
[
"store_id"
])
{
...
...
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