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
229927ee
Commit
229927ee
authored
Jun 06, 2019
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
b9de9ede
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
7 deletions
+17
-7
Statement.php
application/api_broker/controller/Statement.php
+1
-1
StatementService.php
application/api_broker/service/StatementService.php
+16
-6
No files found.
application/api_broker/controller/Statement.php
View file @
229927ee
...
...
@@ -50,7 +50,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
,
$day_or_week
);
$result
=
$this
->
service_
->
selectStatementByAgentId
(
$params
[
"agent_id"
],
$params
[
"time_start"
],
$time_end
,
$day_or_week
,
$this
->
siteId
);
if
(
count
(
$result
)
>
0
)
{
return
$this
->
response
(
"200"
,
"request success"
,
$result
);
...
...
application/api_broker/service/StatementService.php
View file @
229927ee
...
...
@@ -9,6 +9,7 @@ use app\model\GHousesToAgents;
use
app\model\OBargainModel
;
use
app\model\OMarchInModel
;
use
app\model\OReportModel
;
use
app\model\UPhoneFollowUpTemporary
;
use
app\model\Users
;
/**
...
...
@@ -58,13 +59,12 @@ class StatementService
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
selectStatementByAgentId
(
$agent_id
,
$time_start
,
$time_end
,
$day_or_week
)
public
function
selectStatementByAgentId
(
$agent_id
,
$time_start
,
$time_end
,
$day_or_week
,
$site_id
)
{
$field
=
"id,store_id,district_id,level,name,phone,sex,status"
;
$agent_result
=
$this
->
agentModel
->
getAgentById
(
$field
,
[
"agent_id"
=>
$agent_id
]);
//dump($agent_result);
if
(
count
(
$agent_result
)
<=
0
)
{
return
null
;
...
...
@@ -81,7 +81,7 @@ class StatementService
$conditions
[
"agent_id"
]
=
$agent_id
;
$conditions
[
'create_time'
]
=
array
(
'between'
,
array
(
$time_start
,
$time_end
)
);
return
$this
->
selectStatement
(
$conditions
,
$user_type
,
$store_id
,
$district_id
,
$day_or_week
,
$agent_id
);
return
$this
->
selectStatement
(
$conditions
,
$user_type
,
$store_id
,
$district_id
,
$day_or_week
,
$agent_id
,
$site_id
);
}
...
...
@@ -93,7 +93,7 @@ class StatementService
* @param $district_id
* @return array
*/
private
function
selectStatement
(
$conditions
,
$user_type
,
$store_id
,
$district_id
,
$day_or_week
,
$agent_id
)
private
function
selectStatement
(
$conditions
,
$user_type
,
$store_id
,
$district_id
,
$day_or_week
,
$agent_id
,
$site_id
)
{
//房源 客源 带看 月完成
...
...
@@ -123,7 +123,7 @@ class StatementService
$agentIds
.=
$value
[
"id"
]
.
","
;
#列表排除长假经纪人
if
(
$user_type
==
1
and
$value
[
'status'
]
==
0
)
{
//1店长
array_push
(
$store_list
,
$this
->
getStoreList
(
$conditions
,
$value
[
"id"
],
$value
[
"name"
]));
array_push
(
$store_list
,
$this
->
getStoreList
(
$conditions
,
$value
[
"id"
],
$value
[
"name"
]
,
$site_id
));
}
}
$agentIds
=
rtrim
(
$agentIds
,
","
);
...
...
@@ -148,6 +148,10 @@ class StatementService
$result
[
"agent_total"
]
=
count
(
$agents_res
);
$result
[
"house_num"
]
=
$this
->
housesToAgents
->
getAddHouseNumByAgentId
(
$conditions
);
$result
[
"user_num"
]
=
$this
->
userModel
->
getAddUserNumByAgentIdV2
(
$conditions
);
$m_phone_follow_up
=
new
UPhoneFollowUpTemporary
(
$site_id
);
$phone_follow_up_num
=
$m_phone_follow_up
->
getFollowTotal
(
$conditions
);
$result
[
"phone_follow_up_num"
]
=
$phone_follow_up_num
;
//本周带看(报备)
$addMarchInNum
=
$this
->
marchInModel
->
getAddMarchInNum
(
$conditions
);
$result
[
"follow_up_num"
]
=
isset
(
$addMarchInNum
[
0
][
"num"
])
?
$addMarchInNum
[
0
][
"num"
]
:
0
;
...
...
@@ -367,7 +371,7 @@ class StatementService
* @param $agent_name
* @return mixed
*/
private
function
getStoreList
(
$conditions
,
$agent_id
,
$agent_name
)
private
function
getStoreList
(
$conditions
,
$agent_id
,
$agent_name
,
$site_id
)
{
$conditions_
=
$conditions
;
$conditions_
[
"agent_id"
]
=
$agent_id
;
...
...
@@ -380,6 +384,10 @@ class StatementService
$addMarchInNum
=
$this
->
marchInModel
->
getAddMarchInNum
(
$conditions_
);
$store_list
[
"follow_up_num"
]
=
isset
(
$addMarchInNum
[
0
][
"num"
])
?
$addMarchInNum
[
0
][
"num"
]
:
0
;
$m_phone_follow_up
=
new
UPhoneFollowUpTemporary
(
$site_id
);
$phone_follow_up_num
=
$m_phone_follow_up
->
getFollowTotal
(
$conditions_
);
$store_list
[
"phone_follow_up_num"
]
=
$phone_follow_up_num
;
//本周业绩
$start_time
=
date
(
"Y-m-d"
,
strtotime
(
"-6 day"
));
$end_time
=
date
(
"Y-m-d"
);
...
...
@@ -395,6 +403,8 @@ class StatementService
//客源
$addUserNum
=
$this
->
userModel
->
getAddUserNum
(
$where_
);
$store_list
[
"add_user_num"
]
=
isset
(
$addUserNum
[
0
][
"num"
])
?
$addUserNum
[
0
][
"num"
]
:
0
;
return
$store_list
;
}
...
...
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