Commit 92025e9d authored by zhuwei's avatar zhuwei

拨打电话按钮是否显示

parent abfaf3fb
......@@ -240,7 +240,7 @@ class UserLogService
{
//查询客户详情
$field = 'id as user_id,sex,user_pic,user_nick,user_name,user_phone,site_ids,agent_id,user_label,industry_type,price_demand,area_demand';
$field = 'id as user_id,sex,user_pic,user_nick,user_name,user_phone,site_ids,agent_id,user_label,industry_type,price_demand,area_demand,vip';
$result = $this->userModel->getUserDetailStreamline($user_id,$field);
if (count($result) <= 0) {
......@@ -257,21 +257,42 @@ class UserLogService
#是否被收藏
$result["is_collect"] =$this->userDetailIsCollect($user_id, $agent_id);
#拨打电话按钮是否显示
$result['is_phone_button_show'] = $this->isPhoneButtonShow($user_id,$result['user_phone'],$result["agent_id"],$agent_id);
return $result;
}
/**
* 拨打电话按钮是否显示
* @param $user_id
* @param $result_user_phone
* @param $result_agent_id
* @param $agent_id
* @return int
*/
public function isPhoneButtonShow($user_id,$result_user_phone,$result_agent_id,$agent_id)
{
$is_phone_button_show = 1;
#客户是否在保护期内(0:保护器内 1:超过保护期)
$user_service = new UserService();
$result['is_outstrip_twenty_four_hours'] = $user_service->isUserProtect($user_id);
$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);
$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);
$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);
$examine_vip = $vip_services->vip($agent_id);
return $result;
if($is_outstrip_twenty_four_hours == 0 or $is_outpace_call_num == 0 or $is_can_look == 0 or $examine_vip == 0){
$is_phone_button_show = 0;
}
return $is_phone_button_show;
}
/**
......
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