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
0ef9a6d2
Commit
0ef9a6d2
authored
Aug 06, 2018
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
业绩查询 加上当天业绩
parent
b687e857
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
203 additions
and
35 deletions
+203
-35
Performance.php
application/index/controller/Performance.php
+42
-7
PerformanceService.php
application/index/service/PerformanceService.php
+161
-28
No files found.
application/index/controller/Performance.php
View file @
0ef9a6d2
...
@@ -21,6 +21,37 @@ class Performance extends Basic
...
@@ -21,6 +21,37 @@ class Performance extends Basic
$this
->
service_
=
new
PerformanceService
();
$this
->
service_
=
new
PerformanceService
();
}
}
public
function
getSearchTimeType
(
$start_day
,
$end_day
)
{
//todo 1.今天之前,不包括今天
$search_time_type
=
1
;
if
(
(
date
(
'Y-m-d'
,
strtotime
(
$start_day
))
!=
date
(
"Y-m-d"
,
time
()))
&&
(
date
(
'Y-m-d'
,
strtotime
(
$end_day
))
!=
date
(
"Y-m-d"
,
time
()))
){
$search_time_type
=
1
;
}
//todo 2.今天之前,包括今天
if
(
(
date
(
'Y-m-d'
,
strtotime
(
$start_day
))
!=
date
(
"Y-m-d"
,
time
()))
&&
(
date
(
'Y-m-d'
,
strtotime
(
$end_day
))
==
date
(
"Y-m-d"
,
time
()))
){
$search_time_type
=
2
;
}
//todo 3.就只查询今天
if
(
(
date
(
'Y-m-d'
,
strtotime
(
$start_day
))
==
date
(
"Y-m-d"
,
time
()))
&&
(
date
(
'Y-m-d'
,
strtotime
(
$end_day
))
==
date
(
"Y-m-d"
,
time
()))
){
$search_time_type
=
3
;
}
return
$search_time_type
;
}
//TODO 区域业绩排行 District
//TODO 区域业绩排行 District
/**
/**
...
@@ -40,14 +71,16 @@ class Performance extends Basic
...
@@ -40,14 +71,16 @@ class Performance extends Basic
$pageNo
=
empty
(
$this
->
params
[
'pageNo'
])
?
1
:
$this
->
params
[
'pageNo'
];
$pageNo
=
empty
(
$this
->
params
[
'pageNo'
])
?
1
:
$this
->
params
[
'pageNo'
];
$pageSize
=
empty
(
$this
->
params
[
'pageSize'
])
?
15
:
$this
->
params
[
'pageSize'
];
$pageSize
=
empty
(
$this
->
params
[
'pageSize'
])
?
15
:
$this
->
params
[
'pageSize'
];
//默认排序一周 2018-07-18改为本月
//默认排序一周 2018-07-18改为本月
$end_day
=
!
empty
(
$params
[
"end_day"
])
?
$params
[
"end_day"
]
:
date
(
"Y-m-d"
,
time
());
$start_day
=
!
empty
(
$params
[
"start_day"
])
?
$params
[
"start_day"
]
:
date
(
"Y-m-01"
,
time
());
$start_day
=
!
empty
(
$params
[
"start_day"
])
?
$params
[
"start_day"
]
:
date
(
"Y-m-01"
,
time
());
$end_day
=
!
empty
(
$params
[
"end_day"
])
?
$params
[
"end_day"
]
:
date
(
"Y-m-d"
,
time
());
$father_id
=
!
empty
(
$params
[
"father_id"
])
?
$params
[
"father_id"
]
:
''
;
$father_id
=
!
empty
(
$params
[
"father_id"
])
?
$params
[
"father_id"
]
:
''
;
$is_today
=
!
empty
(
$params
[
"is_today"
])
?
$params
[
"is_today"
]
:
0
;
//todo 业绩查询目前分三种情况
$search_time_type
=
$this
->
getSearchTimeType
(
$start_day
,
$end_day
);
$list
=
$this
->
service_
->
totalAgent
(
$params
[
"type"
],
$end_day
,
$start_day
,
$pageNo
,
$pageSize
,
$father_id
,
$
is_today
);
$list
=
$this
->
service_
->
totalAgent
(
$params
[
"type"
],
$end_day
,
$start_day
,
$pageNo
,
$pageSize
,
$father_id
,
$
search_time_type
);
//dump($list);
//dump($list);
if
(
count
(
$list
)
>
0
)
{
if
(
count
(
$list
)
>
0
)
{
$result
[
"list"
]
=
$list
[
'list'
];
$result
[
"list"
]
=
$list
[
'list'
];
...
@@ -84,10 +117,11 @@ class Performance extends Basic
...
@@ -84,10 +117,11 @@ class Performance extends Basic
$end_day
=
!
empty
(
$params
[
"end_day"
])
?
$params
[
"end_day"
]
:
date
(
"Y-m-d"
,
time
());
$end_day
=
!
empty
(
$params
[
"end_day"
])
?
$params
[
"end_day"
]
:
date
(
"Y-m-d"
,
time
());
$start_day
=
!
empty
(
$params
[
"start_day"
])
?
$params
[
"start_day"
]
:
date
(
"Y-m-01"
,
time
());
$start_day
=
!
empty
(
$params
[
"start_day"
])
?
$params
[
"start_day"
]
:
date
(
"Y-m-01"
,
time
());
$father_id
=
!
empty
(
$params
[
"father_id"
])
?
$params
[
"father_id"
]
:
''
;
$father_id
=
!
empty
(
$params
[
"father_id"
])
?
$params
[
"father_id"
]
:
''
;
$is_today
=
!
empty
(
$params
[
"is_today"
])
?
$params
[
"is_today"
]
:
0
;
//todo 业绩查询目前分三种情况
$search_time_type
=
$this
->
getSearchTimeType
(
$start_day
,
$end_day
);
$list
=
$this
->
service_
->
totalAgent
(
$params
[
"type"
],
$end_day
,
$start_day
,
$pageNo
,
$pageSize
,
$father_id
,
$
is_today
);
$list
=
$this
->
service_
->
totalAgent
(
$params
[
"type"
],
$end_day
,
$start_day
,
$pageNo
,
$pageSize
,
$father_id
,
$
search_time_type
);
//dump($list);
//dump($list);
if
(
count
(
$list
)
>
0
)
{
if
(
count
(
$list
)
>
0
)
{
$result
[
"list"
]
=
$list
[
'list'
];
$result
[
"list"
]
=
$list
[
'list'
];
...
@@ -126,10 +160,11 @@ class Performance extends Basic
...
@@ -126,10 +160,11 @@ class Performance extends Basic
$end_day
=
!
empty
(
$params
[
"end_day"
])
?
$params
[
"end_day"
]
:
date
(
"Y-m-d"
,
time
());
$end_day
=
!
empty
(
$params
[
"end_day"
])
?
$params
[
"end_day"
]
:
date
(
"Y-m-d"
,
time
());
$start_day
=
!
empty
(
$params
[
"start_day"
])
?
$params
[
"start_day"
]
:
date
(
"Y-m-01"
,
time
());
$start_day
=
!
empty
(
$params
[
"start_day"
])
?
$params
[
"start_day"
]
:
date
(
"Y-m-01"
,
time
());
$father_id
=
!
empty
(
$params
[
"father_id"
])
?
$params
[
"father_id"
]
:
''
;
$father_id
=
!
empty
(
$params
[
"father_id"
])
?
$params
[
"father_id"
]
:
''
;
$is_today
=
!
empty
(
$params
[
"is_today"
])
?
$params
[
"is_today"
]
:
0
;
//todo 业绩查询目前分三种情况
$search_time_type
=
$this
->
getSearchTimeType
(
$start_day
,
$end_day
);
$list
=
$this
->
service_
->
totalAgent
(
$params
[
"type"
],
$end_day
,
$start_day
,
$pageNo
,
$pageSize
,
$father_id
,
$
is_today
);
$list
=
$this
->
service_
->
totalAgent
(
$params
[
"type"
],
$end_day
,
$start_day
,
$pageNo
,
$pageSize
,
$father_id
,
$
search_time_type
);
//dump($list);
//dump($list);
if
(
count
(
$list
)
>
0
)
{
if
(
count
(
$list
)
>
0
)
{
$result
[
"list"
]
=
$list
[
'list'
];
$result
[
"list"
]
=
$list
[
'list'
];
...
...
application/index/service/PerformanceService.php
View file @
0ef9a6d2
...
@@ -51,7 +51,7 @@ class PerformanceService
...
@@ -51,7 +51,7 @@ class PerformanceService
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
* @throws \think\exception\DbException
*/
*/
public
function
totalAgent
(
$type
,
$yesterday
,
$end_day
,
$pageNo
,
$pageSize
,
$father_id
,
$
is_today
)
public
function
totalAgent
(
$type
,
$yesterday
,
$end_day
,
$pageNo
,
$pageSize
,
$father_id
,
$
search_time_type
)
{
{
$where_
=
[];
$where_
=
[];
$where_
[
'total_time'
]
=
array
(
'between'
,
array
(
$end_day
,
$yesterday
)
);
$where_
[
'total_time'
]
=
array
(
'between'
,
array
(
$end_day
,
$yesterday
)
);
...
@@ -106,7 +106,12 @@ class PerformanceService
...
@@ -106,7 +106,12 @@ class PerformanceService
$value
[
"store_name"
]
=
$info
[
0
][
"store_name"
];
$value
[
"store_name"
]
=
$info
[
0
][
"store_name"
];
$value
[
"district_name"
]
=
$info
[
0
][
"district_name"
];
$value
[
"district_name"
]
=
$info
[
0
][
"district_name"
];
if
(
$is_today
==
1
){
//todo 1.今天之前,不包括今天
//todo 2.今天之前,包括今天
//todo 3.就只查询今天
if
(
$search_time_type
!=
1
){
//如果不等于1,说明需要计算当天的数据,用不用再说
//todo 计算当日业绩 performance_total
//todo 计算当日业绩 performance_total
$where_
=
[];
$where_
=
[];
...
@@ -114,33 +119,79 @@ class PerformanceService
...
@@ -114,33 +119,79 @@ class PerformanceService
//$where_["district_id"] = $district_id;
//$where_["district_id"] = $district_id;
$where_
[
"agent_id"
]
=
$value
[
"agent_id"
];
$where_
[
"agent_id"
]
=
$value
[
"agent_id"
];
$where_
[
'total_time'
]
=
array
(
'between'
,
array
(
$time
.
" 00:00:00"
,
$time
.
" 23:59:59"
)
);
$where_
[
'total_time'
]
=
array
(
'between'
,
array
(
$time
.
" 00:00:00"
,
$time
.
" 23:59:59"
)
);
// $obargain = new OBargainModel();
$obargain
=
new
OBargainModel
();
$obargain
=
new
OBargainModel
();
$performanceSum
=
$obargain
->
getAddBargainNum
(
$where_
,
1
);
//1表示业绩 2表示实收
$performanceSum
=
$obargain
->
getAddBargainNum
(
$where_
,
1
);
//1表示业绩 2表示实收
$value
[
"performance_total"
]
=
isset
(
$performanceSum
[
0
][
"num"
])
?
$performanceSum
[
0
][
"num"
]
:
0
;
if
(
$search_time_type
==
2
){
//如果等于2,说明需要把今天之前的数据跟今天的数据合并起来
//dump($search_time_type);
//dump('如果等于2,说明需要把今天之前的数据跟今天的数据合并起来');
$performance_total
=
isset
(
$performanceSum
[
0
][
"num"
])
?
$performanceSum
[
0
][
"num"
]
:
0
;
$value
[
"performance_total"
]
=
$value
[
"performance_total"
]
+
$performance_total
;
}
else
{
//dump($search_time_type);
//dump('只查询今天的数据');
$value
[
"performance_total"
]
=
isset
(
$performanceSum
[
0
][
"num"
])
?
$performanceSum
[
0
][
"num"
]
:
0
;
}
//todo 计算当日成交单数 bargain_sum
//todo 计算当日成交单数 bargain_sum
$performanceSum
=
$obargain
->
getAddBargainNum
(
$where_
,
3
);
//1表示业绩 2表示实收
$performanceSum
=
$obargain
->
getAddBargainNum
(
$where_
,
3
);
//1表示业绩 2表示实收
$value
[
"bargain_sum_total"
]
=
isset
(
$performanceSum
[
0
][
"num"
])
?
$performanceSum
[
0
][
"num"
]
:
0
;
if
(
$search_time_type
==
2
){
$bargain_sum_total
=
isset
(
$performanceSum
[
0
][
"num"
])
?
$performanceSum
[
0
][
"num"
]
:
0
;
$value
[
"bargain_sum_total"
]
=
$value
[
"bargain_sum_total"
]
+
$bargain_sum_total
;
}
else
{
$value
[
"bargain_sum_total"
]
=
isset
(
$performanceSum
[
0
][
"num"
])
?
$performanceSum
[
0
][
"num"
]
:
0
;
}
//todo 计算当日收款数 paylog
//todo 计算当日收款数 paylog
$receivedSum
=
$this
->
bargainModel
->
getAddBargainNum
(
$where_
,
2
);
//1表示业绩 2表示实收
$receivedSum
=
$this
->
bargainModel
->
getAddBargainNum
(
$where_
,
2
);
//1表示业绩 2表示实收
$value
[
"paylog_total"
]
=
isset
(
$receivedSum
[
0
][
"num"
])
?
$receivedSum
[
0
][
"num"
]
:
0
;
if
(
$search_time_type
==
2
){
$paylog_total
=
isset
(
$receivedSum
[
0
][
"num"
])
?
$receivedSum
[
0
][
"num"
]
:
0
;
$value
[
"paylog_total"
]
=
$value
[
"paylog_total"
]
+
$paylog_total
;
}
else
{
$value
[
"paylog_total"
]
=
isset
(
$receivedSum
[
0
][
"num"
])
?
$receivedSum
[
0
][
"num"
]
:
0
;
}
//todo 计算当日进场数 march_in_num
//todo 计算当日进场数 march_in_num
$addMarchInNum
=
$this
->
marchInModel
->
getAddMarchInNum
(
$where_
);
$addMarchInNum
=
$this
->
marchInModel
->
getAddMarchInNum
(
$where_
);
$value
[
"march_in_num_total"
]
=
isset
(
$addMarchInNum
[
0
][
"num"
])
?
$addMarchInNum
[
0
][
"num"
]
:
0
;
if
(
$search_time_type
==
2
){
$march_in_num_total
=
isset
(
$addMarchInNum
[
0
][
"num"
])
?
$addMarchInNum
[
0
][
"num"
]
:
0
;
$value
[
"march_in_num_total"
]
=
$value
[
"march_in_num_total"
]
+
$march_in_num_total
;
}
else
{
$value
[
"march_in_num_total"
]
=
isset
(
$addMarchInNum
[
0
][
"num"
])
?
$addMarchInNum
[
0
][
"num"
]
:
0
;
}
//todo 计算当日报备数 look_at_num
//todo 计算当日报备数 look_at_num
$reportNum
=
$this
->
reportModel
->
getAddReportNum
(
$where_
);
$reportNum
=
$this
->
reportModel
->
getAddReportNum
(
$where_
);
$value
[
"look_at_num_total"
]
=
isset
(
$reportNum
[
0
][
"num"
])
?
$reportNum
[
0
][
"num"
]
:
0
;
if
(
$search_time_type
==
2
){
$look_at_num_total
=
isset
(
$reportNum
[
0
][
"num"
])
?
$reportNum
[
0
][
"num"
]
:
0
;
$value
[
"look_at_num_total"
]
=
$value
[
"look_at_num_total"
]
+
$look_at_num_total
;
}
else
{
$value
[
"look_at_num_total"
]
=
isset
(
$reportNum
[
0
][
"num"
])
?
$reportNum
[
0
][
"num"
]
:
0
;
}
//todo 计算当日新增商铺数 add_house_num
//todo 计算当日新增商铺数 add_house_num
$addHouseNum
=
$this
->
houseModel
->
getAddHouseNum
(
$where_
);
$addHouseNum
=
$this
->
houseModel
->
getAddHouseNum
(
$where_
);
$value
[
"add_house_num_total"
]
=
isset
(
$addHouseNum
[
0
][
"num"
])
?
$addHouseNum
[
0
][
"num"
]
:
0
;
if
(
$search_time_type
==
2
){
$add_house_num_total
=
isset
(
$addHouseNum
[
0
][
"num"
])
?
$addHouseNum
[
0
][
"num"
]
:
0
;
$value
[
"add_house_num_total"
]
=
$value
[
"add_house_num_total"
]
+
$add_house_num_total
;
}
else
{
$value
[
"add_house_num_total"
]
=
isset
(
$addHouseNum
[
0
][
"num"
])
?
$addHouseNum
[
0
][
"num"
]
:
0
;
}
//todo 计算当日新增客户数 add_user_num
//todo 计算当日新增客户数 add_user_num
$addUserNum
=
$this
->
userModel
->
getAddUserNum
(
$where_
);
$addUserNum
=
$this
->
userModel
->
getAddUserNum
(
$where_
);
$result
[
"add_user_num_total"
]
=
isset
(
$addUserNum
[
0
][
"num"
])
?
$addUserNum
[
0
][
"num"
]
:
0
;
if
(
$search_time_type
==
2
){
$add_user_num_total
=
isset
(
$addUserNum
[
0
][
"num"
])
?
$addUserNum
[
0
][
"num"
]
:
0
;
$value
[
"add_user_num_total"
]
=
$value
[
"add_user_num_total"
]
+
$add_user_num_total
;
}
else
{
$result
[
"add_user_num_total"
]
=
isset
(
$addUserNum
[
0
][
"num"
])
?
$addUserNum
[
0
][
"num"
]
:
0
;
}
}
}
array_push
(
$arr
,
$value
);
array_push
(
$arr
,
$value
);
...
@@ -162,7 +213,7 @@ class PerformanceService
...
@@ -162,7 +213,7 @@ class PerformanceService
$params
[
"status"
]
=
0
;
//只查询正常状态的经纪人
$params
[
"status"
]
=
0
;
//只查询正常状态的经纪人
$value
[
"team_num"
]
=
$this
->
agentModel
->
getAgentsCountByStoreId
(
$params
);
$value
[
"team_num"
]
=
$this
->
agentModel
->
getAgentsCountByStoreId
(
$params
);
if
(
$
is_today
==
1
)
{
if
(
$
search_time_type
!=
1
)
{
//如果不等于1,说明需要计算当天的数据,用不用再说
//查询总监下面门店的所有经纪人
//查询总监下面门店的所有经纪人
$params
=
[];
$params
=
[];
...
@@ -186,30 +237,71 @@ class PerformanceService
...
@@ -186,30 +237,71 @@ class PerformanceService
$where_
[
'create_time'
]
=
array
(
'between'
,
array
(
$time
.
" 04:00:00"
,
$time
.
" 23:59:59"
)
);
$where_
[
'create_time'
]
=
array
(
'between'
,
array
(
$time
.
" 04:00:00"
,
$time
.
" 23:59:59"
)
);
$obargain
=
new
OBargainModel
();
$obargain
=
new
OBargainModel
();
$performanceSum
=
$obargain
->
getAddBargainNum
(
$where_
,
1
);
//1表示业绩 2表示实收
$performanceSum
=
$obargain
->
getAddBargainNum
(
$where_
,
1
);
//1表示业绩 2表示实收
$value
[
"performance_total"
]
=
isset
(
$performanceSum
[
0
][
"num"
])
?
$performanceSum
[
0
][
"num"
]
:
0
;
if
(
$search_time_type
==
2
){
//如果等于2,说明需要把今天之前的数据跟今天的数据合并起来
//dump($search_time_type);
//dump('如果等于2,说明需要把今天之前的数据跟今天的数据合并起来');
$performance_total
=
isset
(
$performanceSum
[
0
][
"num"
])
?
$performanceSum
[
0
][
"num"
]
:
0
;
$value
[
"performance_total"
]
=
$value
[
"performance_total"
]
+
$performance_total
;
}
else
{
//dump($search_time_type);
//dump('只查询今天的数据');
$value
[
"performance_total"
]
=
isset
(
$performanceSum
[
0
][
"num"
])
?
$performanceSum
[
0
][
"num"
]
:
0
;
}
//todo 计算当日成交单数 bargain_sum
//todo 计算当日成交单数 bargain_sum
$performanceSum
=
$obargain
->
getAddBargainNum
(
$where_
,
3
);
//1表示业绩 2表示实收
$performanceSum
=
$obargain
->
getAddBargainNum
(
$where_
,
3
);
//1表示业绩 2表示实收
$value
[
"bargain_sum_total"
]
=
isset
(
$performanceSum
[
0
][
"num"
])
?
$performanceSum
[
0
][
"num"
]
:
0
;
if
(
$search_time_type
==
2
){
$bargain_sum_total
=
isset
(
$performanceSum
[
0
][
"num"
])
?
$performanceSum
[
0
][
"num"
]
:
0
;
$value
[
"bargain_sum_total"
]
=
$value
[
"bargain_sum_total"
]
+
$bargain_sum_total
;
}
else
{
$value
[
"bargain_sum_total"
]
=
isset
(
$performanceSum
[
0
][
"num"
])
?
$performanceSum
[
0
][
"num"
]
:
0
;
}
//todo 计算当日收款数 paylog
//todo 计算当日收款数 paylog
$receivedSum
=
$this
->
bargainModel
->
getAddBargainNum
(
$where_
,
2
);
//1表示业绩 2表示实收
$receivedSum
=
$this
->
bargainModel
->
getAddBargainNum
(
$where_
,
2
);
//1表示业绩 2表示实收
$value
[
"paylog_total"
]
=
isset
(
$receivedSum
[
0
][
"num"
])
?
$receivedSum
[
0
][
"num"
]
:
0
;
if
(
$search_time_type
==
2
){
$paylog_total
=
isset
(
$receivedSum
[
0
][
"num"
])
?
$receivedSum
[
0
][
"num"
]
:
0
;
$value
[
"paylog_total"
]
=
$value
[
"paylog_total"
]
+
$paylog_total
;
}
else
{
$value
[
"paylog_total"
]
=
isset
(
$receivedSum
[
0
][
"num"
])
?
$receivedSum
[
0
][
"num"
]
:
0
;
}
//todo 计算当日进场数 march_in_num
//todo 计算当日进场数 march_in_num
$addMarchInNum
=
$this
->
marchInModel
->
getAddMarchInNum
(
$where_
);
$addMarchInNum
=
$this
->
marchInModel
->
getAddMarchInNum
(
$where_
);
$value
[
"march_in_num_total"
]
=
isset
(
$addMarchInNum
[
0
][
"num"
])
?
$addMarchInNum
[
0
][
"num"
]
:
0
;
if
(
$search_time_type
==
2
){
$march_in_num_total
=
isset
(
$addMarchInNum
[
0
][
"num"
])
?
$addMarchInNum
[
0
][
"num"
]
:
0
;
$value
[
"march_in_num_total"
]
=
$value
[
"march_in_num_total"
]
+
$march_in_num_total
;
}
else
{
$value
[
"march_in_num_total"
]
=
isset
(
$addMarchInNum
[
0
][
"num"
])
?
$addMarchInNum
[
0
][
"num"
]
:
0
;
}
//todo 计算当日报备数 look_at_num
//todo 计算当日报备数 look_at_num
$reportNum
=
$this
->
reportModel
->
getAddReportNum
(
$where_
);
$reportNum
=
$this
->
reportModel
->
getAddReportNum
(
$where_
);
$value
[
"look_at_num_total"
]
=
isset
(
$reportNum
[
0
][
"num"
])
?
$reportNum
[
0
][
"num"
]
:
0
;
if
(
$search_time_type
==
2
){
$look_at_num_total
=
isset
(
$reportNum
[
0
][
"num"
])
?
$reportNum
[
0
][
"num"
]
:
0
;
$value
[
"look_at_num_total"
]
=
$value
[
"look_at_num_total"
]
+
$look_at_num_total
;
}
else
{
$value
[
"look_at_num_total"
]
=
isset
(
$reportNum
[
0
][
"num"
])
?
$reportNum
[
0
][
"num"
]
:
0
;
}
//todo 计算当日新增商铺数 add_house_num
//todo 计算当日新增商铺数 add_house_num
$addHouseNum
=
$this
->
houseModel
->
getAddHouseNum
(
$where_
);
$addHouseNum
=
$this
->
houseModel
->
getAddHouseNum
(
$where_
);
$value
[
"add_house_num_total"
]
=
isset
(
$addHouseNum
[
0
][
"num"
])
?
$addHouseNum
[
0
][
"num"
]
:
0
;
if
(
$search_time_type
==
2
){
$add_house_num_total
=
isset
(
$addHouseNum
[
0
][
"num"
])
?
$addHouseNum
[
0
][
"num"
]
:
0
;
$value
[
"add_house_num_total"
]
=
$value
[
"add_house_num_total"
]
+
$add_house_num_total
;
}
else
{
$value
[
"add_house_num_total"
]
=
isset
(
$addHouseNum
[
0
][
"num"
])
?
$addHouseNum
[
0
][
"num"
]
:
0
;
}
//todo 计算当日新增客户数 add_user_num
//todo 计算当日新增客户数 add_user_num
$addUserNum
=
$this
->
userModel
->
getAddUserNum
(
$where_
);
$addUserNum
=
$this
->
userModel
->
getAddUserNum
(
$where_
);
$result
[
"add_user_num_total"
]
=
isset
(
$addUserNum
[
0
][
"num"
])
?
$addUserNum
[
0
][
"num"
]
:
0
;
if
(
$search_time_type
==
2
){
$add_user_num_total
=
isset
(
$addUserNum
[
0
][
"num"
])
?
$addUserNum
[
0
][
"num"
]
:
0
;
$value
[
"add_user_num_total"
]
=
$value
[
"add_user_num_total"
]
+
$add_user_num_total
;
}
else
{
$result
[
"add_user_num_total"
]
=
isset
(
$addUserNum
[
0
][
"num"
])
?
$addUserNum
[
0
][
"num"
]
:
0
;
}
}
}
array_push
(
$arr
,
$value
);
array_push
(
$arr
,
$value
);
...
@@ -230,8 +322,8 @@ class PerformanceService
...
@@ -230,8 +322,8 @@ class PerformanceService
$params
[
"status"
]
=
0
;
//只查询正常状态的经纪人
$params
[
"status"
]
=
0
;
//只查询正常状态的经纪人
$value
[
"team_num"
]
=
$this
->
agentModel
->
getAgentsCountByStoreId
(
$params
);
$value
[
"team_num"
]
=
$this
->
agentModel
->
getAgentsCountByStoreId
(
$params
);
//dump($search_time_type);
if
(
$
is_today
==
1
)
{
if
(
$
search_time_type
!=
1
)
{
//如果不等于1,说明需要计算当天的数据,用不用再说
//查询总监下面门店的所有经纪人
//查询总监下面门店的所有经纪人
$params
=
[];
$params
=
[];
...
@@ -255,30 +347,71 @@ class PerformanceService
...
@@ -255,30 +347,71 @@ class PerformanceService
$where_
[
'create_time'
]
=
array
(
'between'
,
array
(
$time
.
" 04:00:00"
,
$time
.
" 23:59:59"
)
);
$where_
[
'create_time'
]
=
array
(
'between'
,
array
(
$time
.
" 04:00:00"
,
$time
.
" 23:59:59"
)
);
$obargain
=
new
OBargainModel
();
$obargain
=
new
OBargainModel
();
$performanceSum
=
$obargain
->
getAddBargainNum
(
$where_
,
1
);
//1表示业绩 2表示实收
$performanceSum
=
$obargain
->
getAddBargainNum
(
$where_
,
1
);
//1表示业绩 2表示实收
$value
[
"performance_total"
]
=
isset
(
$performanceSum
[
0
][
"num"
])
?
$performanceSum
[
0
][
"num"
]
:
0
;
if
(
$search_time_type
==
2
){
//如果等于2,说明需要把今天之前的数据跟今天的数据合并起来
//dump($search_time_type);
//dump('如果等于2,说明需要把今天之前的数据跟今天的数据合并起来');
$performance_total
=
isset
(
$performanceSum
[
0
][
"num"
])
?
$performanceSum
[
0
][
"num"
]
:
0
;
$value
[
"performance_total"
]
=
$value
[
"performance_total"
]
+
$performance_total
;
}
else
{
//dump($search_time_type);
//dump('只查询今天的数据');
$value
[
"performance_total"
]
=
isset
(
$performanceSum
[
0
][
"num"
])
?
$performanceSum
[
0
][
"num"
]
:
0
;
}
//todo 计算当日成交单数 bargain_sum
//todo 计算当日成交单数 bargain_sum
$performanceSum
=
$obargain
->
getAddBargainNum
(
$where_
,
3
);
//1表示业绩 2表示实收
$performanceSum
=
$obargain
->
getAddBargainNum
(
$where_
,
3
);
//1表示业绩 2表示实收
$value
[
"bargain_sum_total"
]
=
isset
(
$performanceSum
[
0
][
"num"
])
?
$performanceSum
[
0
][
"num"
]
:
0
;
if
(
$search_time_type
==
2
){
$bargain_sum_total
=
isset
(
$performanceSum
[
0
][
"num"
])
?
$performanceSum
[
0
][
"num"
]
:
0
;
$value
[
"bargain_sum_total"
]
=
$value
[
"bargain_sum_total"
]
+
$bargain_sum_total
;
}
else
{
$value
[
"bargain_sum_total"
]
=
isset
(
$performanceSum
[
0
][
"num"
])
?
$performanceSum
[
0
][
"num"
]
:
0
;
}
//todo 计算当日收款数 paylog
//todo 计算当日收款数 paylog
$receivedSum
=
$this
->
bargainModel
->
getAddBargainNum
(
$where_
,
2
);
//1表示业绩 2表示实收
$receivedSum
=
$this
->
bargainModel
->
getAddBargainNum
(
$where_
,
2
);
//1表示业绩 2表示实收
$value
[
"paylog_total"
]
=
isset
(
$receivedSum
[
0
][
"num"
])
?
$receivedSum
[
0
][
"num"
]
:
0
;
if
(
$search_time_type
==
2
){
$paylog_total
=
isset
(
$receivedSum
[
0
][
"num"
])
?
$receivedSum
[
0
][
"num"
]
:
0
;
$value
[
"paylog_total"
]
=
$value
[
"paylog_total"
]
+
$paylog_total
;
}
else
{
$value
[
"paylog_total"
]
=
isset
(
$receivedSum
[
0
][
"num"
])
?
$receivedSum
[
0
][
"num"
]
:
0
;
}
//todo 计算当日进场数 march_in_num
//todo 计算当日进场数 march_in_num
$addMarchInNum
=
$this
->
marchInModel
->
getAddMarchInNum
(
$where_
);
$addMarchInNum
=
$this
->
marchInModel
->
getAddMarchInNum
(
$where_
);
$value
[
"march_in_num_total"
]
=
isset
(
$addMarchInNum
[
0
][
"num"
])
?
$addMarchInNum
[
0
][
"num"
]
:
0
;
if
(
$search_time_type
==
2
){
$march_in_num_total
=
isset
(
$addMarchInNum
[
0
][
"num"
])
?
$addMarchInNum
[
0
][
"num"
]
:
0
;
$value
[
"march_in_num_total"
]
=
$value
[
"march_in_num_total"
]
+
$march_in_num_total
;
}
else
{
$value
[
"march_in_num_total"
]
=
isset
(
$addMarchInNum
[
0
][
"num"
])
?
$addMarchInNum
[
0
][
"num"
]
:
0
;
}
//todo 计算当日报备数 look_at_num
//todo 计算当日报备数 look_at_num
$reportNum
=
$this
->
reportModel
->
getAddReportNum
(
$where_
);
$reportNum
=
$this
->
reportModel
->
getAddReportNum
(
$where_
);
$value
[
"look_at_num_total"
]
=
isset
(
$reportNum
[
0
][
"num"
])
?
$reportNum
[
0
][
"num"
]
:
0
;
if
(
$search_time_type
==
2
){
$look_at_num_total
=
isset
(
$reportNum
[
0
][
"num"
])
?
$reportNum
[
0
][
"num"
]
:
0
;
$value
[
"look_at_num_total"
]
=
$value
[
"look_at_num_total"
]
+
$look_at_num_total
;
}
else
{
$value
[
"look_at_num_total"
]
=
isset
(
$reportNum
[
0
][
"num"
])
?
$reportNum
[
0
][
"num"
]
:
0
;
}
//todo 计算当日新增商铺数 add_house_num
//todo 计算当日新增商铺数 add_house_num
$addHouseNum
=
$this
->
houseModel
->
getAddHouseNum
(
$where_
);
$addHouseNum
=
$this
->
houseModel
->
getAddHouseNum
(
$where_
);
$value
[
"add_house_num_total"
]
=
isset
(
$addHouseNum
[
0
][
"num"
])
?
$addHouseNum
[
0
][
"num"
]
:
0
;
if
(
$search_time_type
==
2
){
$add_house_num_total
=
isset
(
$addHouseNum
[
0
][
"num"
])
?
$addHouseNum
[
0
][
"num"
]
:
0
;
$value
[
"add_house_num_total"
]
=
$value
[
"add_house_num_total"
]
+
$add_house_num_total
;
}
else
{
$value
[
"add_house_num_total"
]
=
isset
(
$addHouseNum
[
0
][
"num"
])
?
$addHouseNum
[
0
][
"num"
]
:
0
;
}
//todo 计算当日新增客户数 add_user_num
//todo 计算当日新增客户数 add_user_num
$addUserNum
=
$this
->
userModel
->
getAddUserNum
(
$where_
);
$addUserNum
=
$this
->
userModel
->
getAddUserNum
(
$where_
);
$result
[
"add_user_num_total"
]
=
isset
(
$addUserNum
[
0
][
"num"
])
?
$addUserNum
[
0
][
"num"
]
:
0
;
if
(
$search_time_type
==
2
){
$add_user_num_total
=
isset
(
$addUserNum
[
0
][
"num"
])
?
$addUserNum
[
0
][
"num"
]
:
0
;
$value
[
"add_user_num_total"
]
=
$value
[
"add_user_num_total"
]
+
$add_user_num_total
;
}
else
{
$result
[
"add_user_num_total"
]
=
isset
(
$addUserNum
[
0
][
"num"
])
?
$addUserNum
[
0
][
"num"
]
:
0
;
}
}
}
array_push
(
$arr
,
$value
);
array_push
(
$arr
,
$value
);
...
...
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