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
8902a8e8
Commit
8902a8e8
authored
Nov 23, 2018
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
900e2b7a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
115 additions
and
13 deletions
+115
-13
Statement.php
application/api_broker/controller/Statement.php
+11
-11
StatementService.php
application/api_broker/service/StatementService.php
+104
-2
No files found.
application/api_broker/controller/Statement.php
View file @
8902a8e8
...
@@ -214,12 +214,12 @@ class Statement extends Basic
...
@@ -214,12 +214,12 @@ class Statement extends Basic
header
(
'Access-Control-Allow-Origin:*'
);
header
(
'Access-Control-Allow-Origin:*'
);
$params
=
$this
->
params
;
$params
=
$this
->
params
;
//
$params = array(
$params
=
array
(
//
"agent_id" => 5739,//5739 总监 5740店长
"agent_id"
=>
5739
,
//5739 总监 5740店长
//
"type" => 0,//0 日报 1 周报
"type"
=>
0
,
//0 日报 1 周报
//
);
);
if
(
!
isset
(
$params
[
"agent_id"
])
||
!
isset
(
$params
[
"
day_or_week
"
])
)
{
if
(
!
isset
(
$params
[
"agent_id"
])
||
!
isset
(
$params
[
"
type
"
])
)
{
return
$this
->
response
(
"101"
,
"请求参数错误"
);
return
$this
->
response
(
"101"
,
"请求参数错误"
);
}
}
...
@@ -235,15 +235,15 @@ class Statement extends Basic
...
@@ -235,15 +235,15 @@ class Statement extends Basic
$district_id
=
$agent_result
[
0
][
"district_id"
];
$district_id
=
$agent_result
[
0
][
"district_id"
];
if
(
$agent_result
[
0
][
"level"
]
==
10
)
{
if
(
$agent_result
[
0
][
"level"
]
==
10
)
{
//
todo
业务员 Clerk
// 业务员 Clerk
$agent_level
=
0
;
$agent_level
=
0
;
$result
=
$this
->
service_
->
selectStatementForClerk
(
$params
[
"agent_id"
],
$agent_level
,
$store_id
,
$district_id
);
$result
=
$this
->
service_
->
selectStatementForClerk
(
$params
[
"agent_id"
],
$agent_level
,
$store_id
,
$district_id
);
}
elseif
(
$agent_result
[
0
][
"level"
]
==
20
)
{
}
elseif
(
$agent_result
[
0
][
"level"
]
==
20
)
{
//
todo
1店长
// 1店长
$agent_level
=
1
;
$agent_level
=
1
;
if
(
$params
[
"
day_or_week
"
]
==
0
){
if
(
$params
[
"
type
"
]
==
0
){
//
todo
日报
// 日报
$result
=
$this
->
service_
->
selectStatementForStoreWithDay
(
$params
[
"agent_id"
],
$agent_level
,
$store_id
,
$district_id
);
}
else
{
}
else
{
//todo 周报
//todo 周报
...
@@ -251,7 +251,7 @@ class Statement extends Basic
...
@@ -251,7 +251,7 @@ class Statement extends Basic
}
else
{
}
else
{
//todo 2总监
//todo 2总监
$agent_level
=
2
;
$agent_level
=
2
;
if
(
$params
[
"
day_or_week
"
]
==
0
){
if
(
$params
[
"
type
"
]
==
0
){
//todo 日报
//todo 日报
}
else
{
}
else
{
...
...
application/api_broker/service/StatementService.php
View file @
8902a8e8
...
@@ -543,14 +543,14 @@ class StatementService
...
@@ -543,14 +543,14 @@ class StatementService
}
}
/**
/**
* 查询业务员日报数据
* 查询业务员日报数据
* @param $agent_id
* @param $agent_id
* @param $agent_level
* @param $agent_level
* @param $store_id
* @param $store_id
* @param $district_id
* @param $district_id
* user 朱伟
* @return mixed user 朱伟
* time 2018-11-23 11:15:02
* http://showdoc.tonglianjituan.com/index.php?s=/1&page_id=698
* http://showdoc.tonglianjituan.com/index.php?s=/1&page_id=698
*/
*/
public
function
selectStatementForClerk
(
$agent_id
,
$agent_level
,
$store_id
,
$district_id
)
public
function
selectStatementForClerk
(
$agent_id
,
$agent_level
,
$store_id
,
$district_id
)
...
@@ -589,5 +589,106 @@ class StatementService
...
@@ -589,5 +589,106 @@ class StatementService
return
$result
;
return
$result
;
}
}
/**
* 查询店长门店日报数据
* @param $agent_id
* @param $agent_level
* @param $store_id
* @param $district_id
* @return mixed user 朱伟
* http://showdoc.tonglianjituan.com/index.php?s=/1&page_id=698
*/
public
function
selectStatementForStoreWithDay
(
$agent_id
,
$agent_level
,
$store_id
,
$district_id
)
{
$time_
=
date
(
"Y-m-d"
,
time
());
$agent_res
=
$this
->
getAgentIDsByDistrictId
(
$store_id
,
$agent_level
);
$conditions
[
'agent_id'
]
=
array
(
"in"
,
$agent_res
[
'agent_ids'
]
);
$conditions
[
'create_time'
]
=
array
(
'between'
,
array
(
$time_
.
" 00:00:00"
,
$time_
.
" 23:59:59"
)
);
// 房源
$result
[
"house_num"
]
=
$this
->
housesToAgents
->
getAddHouseNumByAgentId
(
$conditions
);
// 客源
$result
[
"user_num"
]
=
$this
->
userModel
->
getAddUserNumByAgentId
(
$conditions
);
// 带看 (报备)
$addMarchInNum
=
$this
->
marchInModel
->
getAddMarchInNum
(
$conditions
);
$result
[
"follow_up_num"
]
=
isset
(
$addMarchInNum
[
0
][
"num"
])
?
$addMarchInNum
[
0
][
"num"
]
:
0
;
// 业绩
$performanceSum
=
$this
->
bargainModel
->
getAddBargainNum
(
$conditions
,
1
);
//1表示业绩 2表示实收
$result
[
"performance"
]
=
isset
(
$performanceSum
[
0
][
"num"
])
?
$performanceSum
[
0
][
"num"
]
:
0
;
// 本月-业绩
$start_time
=
date
(
"Y-m-01"
,
time
());
$end_time
=
date
(
"Y-m-d"
,
time
());
$conditions
[
'create_time'
]
=
array
(
'between'
,
array
(
$start_time
.
" 00:00:00"
,
$end_time
.
" 23:59:59"
)
);
$performanceSum
=
$this
->
bargainModel
->
getAddBargainNum
(
$conditions
,
1
);
//1表示业绩 2表示实收
$result
[
"performance_for_month"
]
=
isset
(
$performanceSum
[
0
][
"num"
])
?
$performanceSum
[
0
][
"num"
]
:
0
;
// 本月-成交单数
$performanceSum
=
$this
->
bargainModel
->
getAddBargainNumV2
(
$conditions
,
3
);
//1表示业绩 2表示实收
$result
[
"bargain_sum_for_month"
]
=
isset
(
$performanceSum
[
0
][
"num"
])
?
$performanceSum
[
0
][
"num"
]
:
0
;
/**查询店长个人数据**/
#店长个人带看(报备)
$time_
=
date
(
"Y-m-d"
,
time
());
$conditions
[
'agent_id'
]
=
$agent_id
;
$conditions
[
'create_time'
]
=
array
(
'between'
,
array
(
$time_
.
" 00:00:00"
,
$time_
.
" 23:59:59"
)
);
$addMarchInNum
=
$this
->
marchInModel
->
getAddMarchInNum
(
$conditions
);
$result
[
"follow_up_num_by_self"
]
=
isset
(
$addMarchInNum
[
0
][
"num"
])
?
$addMarchInNum
[
0
][
"num"
]
:
0
;
#店长个人 成交单数
$performanceSum
=
$this
->
bargainModel
->
getAddBargainNumV2
(
$conditions
,
3
);
//1表示业绩 2表示实收
$result
[
"bargain_sum_by_self"
]
=
isset
(
$performanceSum
[
0
][
"num"
])
?
$performanceSum
[
0
][
"num"
]
:
0
;
/**查询店长旗下业务员数据**/
$result
[
"store_list"
]
=
$agent_res
[
'store_list'
]
;
return
$result
;
}
/**
* 查询门店或者区域下所有经纪人id
* @param $district_or_store_id
* @param $type
* @return string
*/
public
function
getAgentIDsByDistrictId
(
$district_or_store_id
,
$type
)
{
//查询总监下面门店的所有经纪人
$params
=
[];
if
(
$type
==
1
){
$params
[
"store_id"
]
=
$district_or_store_id
;
}
else
{
$params
[
"district_id"
]
=
$district_or_store_id
;
}
$params
[
"status"
]
=
0
;
//只查询正常状态的经纪人
$agentModel
=
new
AAgents
();
$agentsArr
=
$agentModel
->
getAgentsByStoreId
(
$params
);
$agent_total
=
count
(
$agentsArr
);
if
(
$agent_total
>
0
)
{
$agentIds
=
""
;
$store_list
=
[];
foreach
(
$agentsArr
as
$key1
=>
$value1
)
{
$agentIds
.=
$value1
[
"id"
]
.
","
;
// $store_list_["id"] = $value1["id"];
// $store_list_["name"] = $value1["name"];
// $store_list[] = $store_list_;
}
$agentIds
=
rtrim
(
$agentIds
,
","
);
//经纪人ID集合
}
//查询总监下面门店的所有经纪人 end
$return
[
'agent_ids'
]
=
$agentIds
;
$return
[
'store_list'
]
=
$agentsArr
;
$return
[
'store_list_num'
]
=
$agent_total
;
return
$return
;
}
}
}
\ 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