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
ac90399f
Commit
ac90399f
authored
Sep 16, 2019
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
5f978dc3
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
141 additions
and
18 deletions
+141
-18
Broker.php
application/api/controller/Broker.php
+1
-0
Performance.php
application/api_broker/controller/Performance.php
+4
-0
PerformanceService.php
application/api_broker/service/PerformanceService.php
+29
-0
ImageDepot.php
application/index/controller/ImageDepot.php
+1
-1
UserCallStintService.php
application/index/service/UserCallStintService.php
+78
-13
UserLogService.php
application/index/service/UserLogService.php
+28
-4
No files found.
application/api/controller/Broker.php
View file @
ac90399f
...
...
@@ -390,6 +390,7 @@ class Broker extends Basic
*/
public
function
appraiserV2
()
{
header
(
'Access-Control-Allow-Origin:*'
);
$params
=
$this
->
params
;
$data
[
'status'
]
=
101
;
$data
[
'data'
]
=
[];
...
...
application/api_broker/controller/Performance.php
View file @
ac90399f
...
...
@@ -53,6 +53,7 @@ class Performance extends Basic
$start_day
=
!
empty
(
$params
[
"start_day"
])
?
$params
[
"start_day"
]
:
date
(
"Y-m-01"
,
time
());
$list
=
$this
->
service_
->
totalAgent
(
$params
[
"agent_id"
],
$params
[
"type"
],
$start_day
,
$end_day
,
$params
[
"site_id"
]);
$company_list
=
$this
->
service_
->
companyTotalAgent
(
$params
[
"agent_id"
],
$params
[
"type"
],
$start_day
,
$end_day
);
$all_performance_total
=
$all_official_receipts_total
=
0
;
foreach
(
$list
as
$key
=>
$value
)
{
$all_performance_total
+=
$value
[
'performance_total'
];
...
...
@@ -70,6 +71,9 @@ class Performance extends Basic
}
$result
[
"all_performance_total"
]
=
$all_performance_total
;
$result
[
"all_official_receipts_total"
]
=
$all_official_receipts_total
;
$result
[
"company_performance_total"
]
=
$company_list
[
'company_performance_total'
];
$result
[
"company_official_receipts_total"
]
=
$company_list
[
'company_official_receipts_total'
];
return
$this
->
response
(
"200"
,
"request success"
,
$result
);
}
return
$this
->
response
(
"200"
,
"request null"
);
...
...
application/api_broker/service/PerformanceService.php
View file @
ac90399f
...
...
@@ -137,6 +137,35 @@ class PerformanceService
}
public
function
companyTotalAgent
(
$agent_id
,
$type
,
$yesterday
,
$end_day
)
{
$params
[
"agent_id"
]
=
$agent_id
;
$agent_info
=
$this
->
agentModel
->
getAgentById
(
"id,store_id,district_id,level"
,
$params
);
if
(
count
(
$agent_info
)
>
0
)
{
$agent_info
=
$agent_info
[
0
];
}
$where_
=
[];
// $where_['d.site_id'] = $site_id;
$where_
[
'a.total_time'
]
=
array
(
'between'
,
array
(
$yesterday
,
$end_day
)
);
$field
=
" a.agent_id,
a.store_id,
a.district_id,
sum(a.performance) as performance_total,
sum(a.official_receipts) as official_receipts_total
"
;
$order
=
"performance_total desc"
;
$result
=
$this
->
totalModel
->
getTotalByAgentIdSite
(
$field
,
$where_
,
$type
,
$order
);
$company_performance_total
=
$company_official_receipts_total
=
0
;
foreach
(
$result
as
$key
=>
$value
)
{
$company_performance_total
+=
$value
[
'performance_total'
];
$company_official_receipts_total
+=
$value
[
'official_receipts_total'
];
}
$result_
[
'company_performance_total'
]
=
$company_performance_total
;
$result_
[
'company_official_receipts_total'
]
=
$company_official_receipts_total
;
return
$result_
;
}
/**
* 个人业绩
...
...
application/index/controller/ImageDepot.php
View file @
ac90399f
...
...
@@ -182,7 +182,7 @@ class ImageDepot extends Basic
$m
=
new
UserCallStintService
();
$user_id
=
87
;
//135558 135562 87
// $res = $m->getUserBindList($user_id);
$res
=
$m
->
isRepor
t
(
$user_id
);
$res
=
$m
->
getUserReportAgentIdLis
t
(
$user_id
);
dump
(
$res
);
}
...
...
application/index/service/UserCallStintService.php
View file @
ac90399f
...
...
@@ -23,6 +23,69 @@ class UserCallStintService
$this
->
m_report
=
new
OReportModel
();
}
/**
* 主方法
* 客户当天是否有约带看
* 显示客户'约带看中'状态
* 包括关联的客户
* 0:不显示 1:显示
* @param $user_id
* @return int
*/
public
function
isUserReport
(
$user_id
){
$is_report
=
0
;
$band_user_list
=
$this
->
getUserBindList
(
$user_id
);
foreach
(
$band_user_list
as
$v
)
{
$res
=
$this
->
findReport
(
$v
);
if
(
$res
){
$is_report
=
1
;
break
;
}
}
return
$is_report
;
}
/**
* 主方法
* 客户当天是否有约带看的经纪人id列表
* @param $user_id
* @return array
*/
public
function
getUserReportAgentIdList
(
$user_id
){
$agent_ids
=
[];
$band_user_list
=
$this
->
getUserBindList
(
$user_id
);
foreach
(
$band_user_list
as
$v
)
{
$res
=
$this
->
findReportAgentIdList
(
$v
);
if
(
$res
){
foreach
(
$res
as
$v1
)
{
$agent_ids
[]
=
$v1
[
'report_agent_id'
];
}
}
}
return
$agent_ids
;
}
/**
* 根据客户id查询有绑定关系的所有客户
* @param $user_id
...
...
@@ -75,22 +138,23 @@ class UserCallStintService
/**
*
客户当天是否有约带看 包括关联的客户
*
经纪人id
* @param $user_id
* @return
bool
* @return
false|\PDOStatement|string|\think\Collection
*/
public
function
isUserReport
(
$user_id
){
$is_report
=
false
;
$band_user_list
=
$this
->
getUserBindList
(
$user_id
);
foreach
(
$band_user_list
as
$v
)
{
$res
=
$this
->
findReport
(
$v
);
if
(
$res
){
$is_report
=
true
;
break
;
}
}
return
$is_report
;
public
function
findReportAgentIdList
(
$user_id
){
$begin_date
=
date
(
"Y-m-d 00:00:00"
);
$end_date
=
date
(
"Y-m-d 23:23:23"
);
// $conditions['report_agent_id'] = $agent_id;
$conditions
[
'user_id'
]
=
$user_id
;
$conditions
[
'predict_see_time'
]
=
array
(
'between'
,
array
(
$begin_date
,
$end_date
));
$report
=
$this
->
m_report
->
selectReportByIdTime
(
'report_agent_id'
,
$conditions
);
return
$report
;
}
}
\ No newline at end of file
application/index/service/UserLogService.php
View file @
ac90399f
...
...
@@ -269,13 +269,20 @@ class UserLogService
$user_service
=
new
UserService
();
$result
[
"is_outstrip_twenty_four_hours"
]
=
$user_service
->
isUserProtect
(
$user_id
);
#有约带看的客户显示 '约带看'标签 0:不显示 1:显示
$s_user_call
=
new
UserCallStintService
();
$is_user_report
=
$s_user_call
->
isUserReport
(
$user_id
);
$result
[
'is_user_report'
]
=
$is_user_report
;
#拨打电话按钮是否显示 0:显示 1:不显示
$result
[
'is_phone_button_show'
]
=
$this
->
isPhoneButtonShow
(
$user_id
,
$agent_id
,
$result
[
'vip'
],
$result
[
'user_phone'
],
$result
[
'agent_id'
]);
$result
[
'is_phone_button_show'
]
=
$this
->
isPhoneButtonShow
(
$user_id
,
$agent_id
,
$result
[
'vip'
],
$result
[
'user_phone'
],
$result
[
'agent_id'
]);
#编辑客户详情权限 0:有权限 1:无权限
$result
[
'is_can_edit_user_info'
]
=
$user_service
->
isCanEditUserInfo
(
$result
[
"agent_id"
],
$agent_id
,
$user_id
);
// $this->agentLookUser($user_id, $agent_id, 0); //记录经纪人看客户
//$this->agentLookUser($user_id, $agent_id, 0); //记录经纪人看客户
return
$result
;
}
...
...
@@ -385,6 +392,24 @@ class UserLogService
#经纪人客户是否有约带看 0:可查看 1:不可查看
$is_report
=
$user_service
->
isReport
(
$agent_id
,
$user_id
);
#当天有约带看的客户 0:不显示 1:显示
$s_user_call
=
new
UserCallStintService
();
$is_user_report
=
$s_user_call
->
isUserReport
(
$user_id
);
//3.3.9 如果有约带看 同时过保护期了
if
(
$is_user_report
==
1
and
(
$is_outstrip_twenty_four_hours
==
1
)){
$s_user_call
=
new
UserCallStintService
();
$report_agents
=
$s_user_call
->
getUserReportAgentIdList
(
$user_id
);
//3.3.9 有约带看订单的客户 预计到场当天 只能 约带看提交人 或 客方 拨打电话
if
((
$result_agent_id
==
$agent_id
)
or
(
in_array
(
$agent_id
,
$report_agents
))){
return
0
;
}
else
{
return
1
;
}
}
#当天有约带看的客户 0:不显示 1:显示
$result_val
=
1
;
if
(
((
$is_outpace_call_num
==
0
)
and
(
$is_outstrip_twenty_four_hours
==
1
)
and
(
$is_vip
!=
1
)
)
//过保护期
OR
...
...
@@ -403,9 +428,8 @@ class UserLogService
(
$is_report
==
0
)
){
return
0
;
//0:显示
}
else
{
return
1
;
//1:不显示
}
return
$result_val
;
}
/**
...
...
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