Commit 5d622ef3 authored by zhuwei's avatar zhuwei

拨打电话按钮是否显示

parent a3815b7f
...@@ -297,77 +297,90 @@ class UserLogService ...@@ -297,77 +297,90 @@ class UserLogService
*/ */
public function isPhoneButtonShow($user_id,$result_user_phone,$result_agent_id,$agent_id,$is_vip) public function isPhoneButtonShow($user_id,$result_user_phone,$result_agent_id,$agent_id,$is_vip)
{ {
big_log('++++++++++++++++++++++++++++++++++++');
$is_phone_button_show = 0;
$user_service = new UserService(); $user_service = new UserService();
$vip_services = new VipService();
if($result_agent_id == $agent_id){ // if($result_agent_id == $agent_id){
big_log('0 客方 '); // big_log('0 客方 ');
return $is_phone_button_show; // return $is_phone_button_show;
} // }
#查询当前经纪人是否是某个客方的总监 0:可查看 1:不可查看
$is_can_look = $user_service->isUserAgentDirector($result_agent_id, $agent_id);
if($is_vip == 1){ // if($is_can_look == 0){
$is_phone_button_show = 1; // big_log('5 查询当前经纪人是否是某个客方的总监 是');
big_log('1 是vip客户 '); // $is_phone_button_show = 0;
}else{ // }else{
big_log('1 不是vip客户'); // big_log('5 查询当前经纪人是否是某个客方的总监 不是');
} // }
// if($is_vip == 1){
// $is_phone_button_show = 1;
// big_log('1 是vip客户 ');
// }else{
// big_log('1 不是vip客户');
// }
#判断当天被拨打是否超过5次 (0:拨打不超过5次 1:超过5次) #判断当天被拨打是否超过5次 (0:拨打不超过5次 1:超过5次)
$is_outpace_call_num = $this->userDetailIsOutpaceCallNum5($user_id); $is_outpace_call_num = $this->userDetailIsOutpaceCallNum5($user_id);
if($is_outpace_call_num == 1 ){ // if($is_outpace_call_num == 1 ){
big_log('2 当天被拨打超过过5次'); // big_log('2 当天被拨打超过过5次');
$is_phone_button_show = 1; // $is_phone_button_show = 1;
}else{ // }else{
big_log('2 当天被拨打不超过5次'); // big_log('2 当天被拨打不超过5次');
} // }
//是否有绑定关系 0有 1无 //是否有绑定关系 0有 1无
$called = $this->userDetailIsOutpaceCallNumPhone($result_user_phone, $agent_id); $called = $this->userDetailIsOutpaceCallNumPhone($result_user_phone, $agent_id);
if($called == 1){ // if($called == 1){
big_log('3 有绑定关系'); // big_log('3 有绑定关系');
$is_phone_button_show = 1; // $is_phone_button_show = 1;
}else{ // }else{
big_log('3 无绑定关系'); // big_log('3 无绑定关系');
} // }
#客户是否在保护期内(0:保护器内 1:超过保护期) #客户是否在保护期内(0:保护器内 1:超过保护期)
$is_outstrip_twenty_four_hours = $user_service->isUserProtect($user_id); $is_outstrip_twenty_four_hours = $user_service->isUserProtect($user_id);
if($is_outstrip_twenty_four_hours == 0){ // if($is_outstrip_twenty_four_hours == 0){
big_log('4 客户在保护期内'); // big_log('4 客户在保护期内');
$is_phone_button_show = 1; // $is_phone_button_show = 1;
}else{ // }else{
big_log('4 客户不在保护期内'); // big_log('4 客户不在保护期内');
} // }
#查询当前经纪人是否是某个客方的总监 0:可查看 1:不可查看
$is_can_look = $user_service->isUserAgentDirector($result_agent_id, $agent_id);
if($is_can_look == 0){
big_log('5 查询当前经纪人是否是某个客方的总监 是');
$is_phone_button_show = 0;
}else{
big_log('5 查询当前经纪人是否是某个客方的总监 不是');
}
$vip_services = new VipService();
#是否有权限查看vip客户 0:可查看 1:不可查看 #是否有权限查看vip客户 0:可查看 1:不可查看
$examine_vip = $vip_services->vip($agent_id); $examine_vip = $vip_services->vip($agent_id);
if($examine_vip == 0 and $is_vip == 1){ // if($examine_vip == 0 and $is_vip == 1){
big_log('6 有查看vip客户权限 '); // big_log('6 有查看vip客户权限 ');
$is_phone_button_show = 0; // $is_phone_button_show = 0;
}else{ // }else{
big_log('6 无查看vip客户权限'); // big_log('6 无查看vip客户权限');
} // }
return $is_phone_button_show; if(
($is_can_look == 0)//总监可以看
OR
($result_agent_id == $agent_id)//客方可以看
OR
(($is_vip == 1) and ($examine_vip == 0))
OR
(($is_outstrip_twenty_four_hours == 0) and (($is_can_look == 0) or ($result_agent_id == $agent_id) or ($called == 1)))
OR
(($is_outpace_call_num == 1 ) and (($is_can_look == 0) or ($result_agent_id == $agent_id) or ($called == 1)))
){
return 0;
}else{//0:显示 1:不显示
return 1;
}
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment