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
42ea9009
Commit
42ea9009
authored
Jan 04, 2019
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
客户详情简略信息 方法拆分
parent
f380f349
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
40 deletions
+54
-40
UserLogService.php
application/index/service/UserLogService.php
+53
-39
UserService.php
application/index/service/UserService.php
+1
-1
No files found.
application/index/service/UserLogService.php
View file @
42ea9009
...
@@ -220,29 +220,49 @@ class UserLogService
...
@@ -220,29 +220,49 @@ class UserLogService
{
{
//查询客户详情
//查询客户详情
$field
=
'id as user_id,user_pic,user_nick,user_name,user_phone,site_ids,agent_id'
;
$field
=
'id as user_id,user_pic,user_nick,user_name,user_phone,site_ids,agent_id
,user_label
'
;
$result
=
$this
->
userModel
->
getUserDetailStreamline
(
$user_id
,
$field
);
$result
=
$this
->
userModel
->
getUserDetailStreamline
(
$user_id
,
$field
);
if
(
count
(
$result
)
<=
0
)
{
if
(
count
(
$result
)
<=
0
)
{
return
[
"code"
=>
101
,
"msg"
=>
"没找到此条用户信息"
];
return
[
"code"
=>
101
,
"msg"
=>
"没找到此条用户信息"
];
}
}
$result
[
'user_pic'
]
=
HEADERIMGURL
.
$result
[
'user_pic'
];
$result
[
'user_pic'
]
=
HEADERIMGURL
.
$result
[
'user_pic'
];
$result
[
'agent_path'
]
=
AGENTHEADERIMGURL
;
#判断是否纯房东 0:否 1:是
/*查询站点名*/
$result
[
'is_single_homeowner'
]
=
$result
[
'user_label'
]
==
2
?
1
:
0
;
$site_model
=
new
ASite
();
foreach
(
explode
(
','
,
$result
[
'site_ids'
])
as
$site_k
=>
$site_v
)
{
$site_field
=
'city'
;
$site_params
[
'id'
]
=
$site_v
;
$site_model
=
$site_model
->
findByOne
(
$site_field
,
$site_params
);
$user_res
[
'site_name'
][]
=
$site_model
[
"city"
];
}
/*查询站点名*/
#根据站点id组装站点名字
$s_index_user
=
new
UserService
();
$result
[
'site_ids_name'
]
=
$s_index_user
->
userSiteName
(
$result
[
"site_ids"
]);
#是否被收藏
$result
[
"is_collect"
]
=
$this
->
userDetailIsCollect
(
$user_id
,
$agent_id
);
/*是否被收藏 start*/
#客户是否在保护期内(0:保护器内 1:超过保护期)
$result
[
"is_collect"
]
=
2
;
$user_service
=
new
UserService
();
$result
[
'is_outstrip_twenty_four_hours'
]
=
$user_service
->
isUserProtect
(
$user_id
);
#判断当天被拨打是否超过5次,同时判断是否当前经纪人跟当前客户是否有电话绑定(0允许拨打 1不允许拨打)
$result
[
'is_outpace_call_num'
]
=
$this
->
userDetailIsOutpaceCallNum
(
$user_id
,
$result
[
'user_phone'
],
$agent_id
);
#查询当前经纪人是否是某个客方的总监 0:可查看 1:不可查看
$result
[
'is_can_look'
]
=
$user_service
->
isUserAgentDirector
(
$result
[
"agent_id"
],
$agent_id
);
$vip_services
=
new
VipService
();
#是否有权限查看vip客户 0:可查看 1:不可查看
$result
[
'examine_vip'
]
=
$vip_services
->
vip
(
$agent_id
);
return
$result
;
}
/**
* 是否被收藏
* @param $user_id
* @param $agent_id
* @return int
*/
public
function
userDetailIsCollect
(
$user_id
,
$agent_id
)
{
$is_collect
=
2
;
//先判断是否已经存在数据
//先判断是否已经存在数据
$field
=
'id,status'
;
$field
=
'id,status'
;
$get_params
[
'agents_id'
]
=
$agent_id
;
$get_params
[
'agents_id'
]
=
$agent_id
;
...
@@ -250,41 +270,34 @@ class UserLogService
...
@@ -250,41 +270,34 @@ class UserLogService
$collect_house
=
new
ACollectUser
();
$collect_house
=
new
ACollectUser
();
$res
=
$collect_house
->
getCollectUser
(
$field
,
$get_params
);
$res
=
$collect_house
->
getCollectUser
(
$field
,
$get_params
);
if
(
$res
&&
(
$res
[
0
][
'status'
]
==
1
))
{
//如果存在
if
(
$res
&&
(
$res
[
0
][
'status'
]
==
1
))
{
//如果存在
$
result
[
"is_collect"
]
=
1
;
$
is_collect
=
1
;
}
}
/*是否被收藏 end*/
return
$is_collect
;
}
/*判断客户是否超过24小时保护期间 0:保护器内 1:超过保护期 start*/
//查询客户是否在保护期内
$user_service
=
new
UserService
();
$is_outstrip_twenty_four_hours
=
$user_service
->
isUserProtect
(
$user_id
);
$result
[
'is_outstrip_twenty_four_hours'
]
=
$is_outstrip_twenty_four_hours
;
/*判断客户是否超过24小时保护期间 0:保护器内 1:超过保护期 end*/
// 判断当天被拨打是否超过5次,同时判断是否当前经纪人跟当前客户是否有电话绑定
/**
//0允许拨打 1不允许拨打
* 判断当天被拨打是否超过5次
$result
[
'is_outpace_call_num'
]
=
0
;
* 同时判断是否当前经纪人跟当前客户是否有电话绑定
* @param $user_id
* @param $user_phone
* @param $agent_id
* @return int
*/
public
function
userDetailIsOutpaceCallNum
(
$user_id
,
$user_phone
,
$agent_id
)
{
$is_outpace_call_num
=
0
;
$clientService
=
new
ClientService
();
$clientService
=
new
ClientService
();
if
(
!
$clientService
->
dialTotal
(
$user_id
))
{
if
(
!
$clientService
->
dialTotal
(
$user_id
))
{
$
result
[
'is_outpace_call_num'
]
=
1
;
$
is_outpace_call_num
=
1
;
}
}
$model
=
new
AAgents
();
$model
=
new
AAgents
();
$agent_res
=
$model
->
searchAgentsByKeyword
(
"id,name,phone"
,
[
"id"
=>
$agent_id
]);
$agent_res
=
$model
->
searchAgentsByKeyword
(
"id,name,phone"
,
[
"id"
=>
$agent_id
]);
$call
=
new
CallPhoneService
();
$call
=
new
CallPhoneService
();
$bind_num_res
=
$call
->
getBindNum
(
$
result
[
'user_phone'
]
,
$agent_res
[
0
][
'phone'
]);
$bind_num_res
=
$call
->
getBindNum
(
$
user_phone
,
$agent_res
[
0
][
'phone'
]);
if
(
$bind_num_res
!=
0
)
{
if
(
$bind_num_res
!=
0
)
{
$
result
[
'is_outpace_call_num'
]
=
0
;
$
is_outpace_call_num
=
0
;
}
}
return
$is_outpace_call_num
;
//查询当前经纪人是否是某个客方的总监 0:可查看 1:不可查看
$result
[
'is_can_look'
]
=
$user_service
->
isUserAgentDirector
(
$result
[
"agent_id"
],
$agent_id
);
$vip_services
=
new
VipService
();
//是否可以查看vip客户 0:可查看 1:不可查看
$result
[
'examine_vip'
]
=
$vip_services
->
vip
(
$agent_id
);
return
$result
;
}
}
}
}
\ No newline at end of file
application/index/service/UserService.php
View file @
42ea9009
...
@@ -595,7 +595,7 @@ class UserService
...
@@ -595,7 +595,7 @@ class UserService
}
}
//bind_id是否等于0 是否主账号
//bind_id是否等于0 是否主账号
$user_info
=
$this
->
user
->
getUserById
(
$field
=
'bind_id'
,
$user_id
);
$user_info
=
$this
->
user
->
getUserById
(
$field
=
'bind_id'
,
$user_id
);
$field
=
'user_name,user_phone,bind_id'
;
$field
=
'
id as user_id,user_nick,
user_name,user_phone,bind_id'
;
if
(
$user_info
[
'bind_id'
]
==
0
){
if
(
$user_info
[
'bind_id'
]
==
0
){
//主账号只需要查bind_id等于当前用户的ID
//主账号只需要查bind_id等于当前用户的ID
$where
[
'bind_id'
]
=
$user_id
;
$where
[
'bind_id'
]
=
$user_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