Commit ab427e20 authored by zhuwei's avatar zhuwei

有约带看的客户显示

parent 0a08638c
...@@ -34,15 +34,23 @@ class UserCallStintService ...@@ -34,15 +34,23 @@ class UserCallStintService
* @return int * @return int
*/ */
public function isUserReport($user_id){ public function isUserReport($user_id){
big_log("+++++++++++++++客户ID:{$user_id}+++++++++++++++++++");
$is_report = []; $is_report = [];
$band_user_list = $this->getUserBindList($user_id); $band_user_list = $this->getUserBindList($user_id);
big_log('关联客户');
big_log($band_user_list);
foreach ($band_user_list as $v) { foreach ($band_user_list as $v) {
$res = $this->findReport($v); $res = $this->findReport($v);
big_log("客户ID:{$v}当天是否有约带看");
big_log($res);
if($res){ if($res){
$is_report = $res; $is_report = $res;
break; break;
} }
} }
big_log('关联客户');
big_log('++++++++++++++++++++++++++++++++++');
return $is_report; return $is_report;
} }
......
...@@ -131,9 +131,7 @@ class UserLogService ...@@ -131,9 +131,7 @@ class UserLogService
$this->sendRequestByCurl($agent_id, $user_id, 1); $this->sendRequestByCurl($agent_id, $user_id, 1);
#有约带看的客户显示 '约带看'标签 0:不显示 1:显示 #有约带看的客户显示 '约带看'标签 0:不显示 1:显示
$s_user_call = new UserCallStintService(); $data['is_user_report'] = $this->isUserReport($user_id);
$is_user_report = $s_user_call->isUserReport($user_id);
$data['is_user_report'] = $is_user_report ? 1 : 0;
return ["code" => 200, "data" => $data]; return ["code" => 200, "data" => $data];
} }
...@@ -278,9 +276,7 @@ class UserLogService ...@@ -278,9 +276,7 @@ class UserLogService
$result["is_outstrip_twenty_four_hours"] = $user_service->isUserProtect($user_id); $result["is_outstrip_twenty_four_hours"] = $user_service->isUserProtect($user_id);
#有约带看的客户显示 '约带看'标签 0:不显示 1:显示 #有约带看的客户显示 '约带看'标签 0:不显示 1:显示
$s_user_call = new UserCallStintService(); $result['is_user_report'] = $this->isUserReport($user_id);
$is_user_report = $s_user_call->isUserReport($user_id);
$result['is_user_report'] = $is_user_report ? 1 : 0;
#拨打电话按钮是否显示 0:显示 1:不显示 #拨打电话按钮是否显示 0:显示 1:不显示
...@@ -297,6 +293,36 @@ class UserLogService ...@@ -297,6 +293,36 @@ class UserLogService
return $result; return $result;
} }
/**
* 有约带看的客户显示
* @param $user_id
* @return int
*/
public function isUserReport($user_id)
{
$s_user_call = new UserCallStintService();
$is_user_report = $s_user_call->isUserReport($user_id);
//3.3.9 如果有约带看 预计到场时间的前1小时和后1小时,除了提交约带看的经纪人和客方,其他人都无法联系客户(包括关联客户)!
$front_see_time = strtotime ("-1 hour", strtotime($is_user_report[0]['predict_see_time']));
$behind_see_time = strtotime ("+1 hour", strtotime($is_user_report[0]['predict_see_time']));
#客户是否在保护期内(0:保护器内 1:超过保护期)
// $user_service = new UserService();
// $is_outstrip_twenty_four_hours = $user_service->isUserProtect($user_id);
if (($is_user_report && (time() < $behind_see_time &&(time() > $front_see_time)))) {
$res = 1;
}else{
//无约带看
$res = 0;
}
return $res;
}
/** /**
* app客户详情 2 * app客户详情 2
* @param $user_id * @param $user_id
...@@ -365,11 +391,17 @@ class UserLogService ...@@ -365,11 +391,17 @@ class UserLogService
//3.3.9 如果有约带看 预计到场时间的前1小时和后1小时,除了提交约带看的经纪人和客方,其他人都无法联系客户(包括关联客户)! //3.3.9 如果有约带看 预计到场时间的前1小时和后1小时,除了提交约带看的经纪人和客方,其他人都无法联系客户(包括关联客户)!
$front_see_time = strtotime ("-1 hour", strtotime($is_user_report[0]['predict_see_time'])); $front_see_time = strtotime ("-1 hour", strtotime($is_user_report[0]['predict_see_time']));
$behind_see_time = strtotime ("+1 hour", strtotime($is_user_report[0]['predict_see_time'])); $behind_see_time = strtotime ("+1 hour", strtotime($is_user_report[0]['predict_see_time']));
big_log($is_user_report[0]['predict_see_time']);
#客户是否在保护期内(0:保护器内 1:超过保护期) #客户是否在保护期内(0:保护器内 1:超过保护期)
$user_service = new UserService(); $user_service = new UserService();
$is_outstrip_twenty_four_hours = $user_service->isUserProtect($user_id); $is_outstrip_twenty_four_hours = $user_service->isUserProtect($user_id);
big_log('客户是否在保护期内'.$is_outstrip_twenty_four_hours);
big_log($is_user_report);
big_log(date("Y-m-d H:i:s",$front_see_time));
big_log(time());
big_log(date("Y-m-d H:i:s"));
big_log(date("Y-m-d H:i:s", $behind_see_time));
if (($is_outstrip_twenty_four_hours == 1) && ($is_user_report && (time() < $behind_see_time &&(time() > $front_see_time)))) { if (($is_outstrip_twenty_four_hours == 1) && ($is_user_report && (time() < $behind_see_time &&(time() > $front_see_time)))) {
big_log("客户ID:{$user_id} 有约带看"); big_log("客户ID:{$user_id} 有约带看");
$res = $this->isPhoneButtonShowA($user_id, $agent_id, $is_vip, $result_user_phone, $result_agent_id); $res = $this->isPhoneButtonShowA($user_id, $agent_id, $is_vip, $result_user_phone, $result_agent_id);
...@@ -381,6 +413,15 @@ class UserLogService ...@@ -381,6 +413,15 @@ class UserLogService
return $res; return $res;
} }
/**
* 拨打电话按钮 是否显示 2
* @param $user_id
* @param $agent_id
* @param $is_vip
* @param $result_user_phone
* @param $result_agent_id
* @return int
*/
public function isPhoneButtonShowA($user_id, $agent_id, $is_vip, $result_user_phone, $result_agent_id) public function isPhoneButtonShowA($user_id, $agent_id, $is_vip, $result_user_phone, $result_agent_id)
{ {
#当天有约带看的客户 0:不显示 1:显示 #当天有约带看的客户 0:不显示 1:显示
...@@ -395,6 +436,15 @@ class UserLogService ...@@ -395,6 +436,15 @@ class UserLogService
} }
} }
/**
* 拨打电话按钮 是否显示
* @param $user_id
* @param $agent_id
* @param $is_vip
* @param $result_user_phone
* @param $result_agent_id
* @return int
*/
public function isPhoneButtonShowB($user_id, $agent_id, $is_vip, $result_user_phone, $result_agent_id) public function isPhoneButtonShowB($user_id, $agent_id, $is_vip, $result_user_phone, $result_agent_id)
{ {
$user_service = new UserService(); $user_service = new UserService();
......
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