Commit 65c0e2af authored by zhuwei's avatar zhuwei

1

parent c33309b8
...@@ -34,12 +34,12 @@ class UserCallStintService ...@@ -34,12 +34,12 @@ class UserCallStintService
* @return int * @return int
*/ */
public function isUserReport($user_id){ public function isUserReport($user_id){
$is_report = 0; $is_report = [];
$band_user_list = $this->getUserBindList($user_id); $band_user_list = $this->getUserBindList($user_id);
foreach ($band_user_list as $v) { foreach ($band_user_list as $v) {
$res = $this->findReport($v); $res = $this->findReport($v);
if($res){ if($res){
$is_report = 1; $is_report = $res;
break; break;
} }
} }
...@@ -117,7 +117,7 @@ class UserCallStintService ...@@ -117,7 +117,7 @@ class UserCallStintService
/** /**
* 客户今天是否有约带看 * 客户今天是否有约带看
* @param $user_id * @param $user_id
* @return bool * @return array|false|\PDOStatement|string|\think\Collection
*/ */
public function findReport($user_id){ public function findReport($user_id){
$begin_date = date("Y-m-d 00:00:00"); $begin_date = date("Y-m-d 00:00:00");
...@@ -126,12 +126,12 @@ class UserCallStintService ...@@ -126,12 +126,12 @@ class UserCallStintService
// $conditions['report_agent_id'] = $agent_id; // $conditions['report_agent_id'] = $agent_id;
$conditions['user_id'] = $user_id; $conditions['user_id'] = $user_id;
$conditions['predict_see_time'] = array( 'between', array( $begin_date, $end_date)); $conditions['predict_see_time'] = array( 'between', array( $begin_date, $end_date));
$report = $this->m_report->selectReportByIdTime('id',$conditions); $report = $this->m_report->selectReportByIdTime('id,predict_see_time',$conditions);
if (count($report) > 0) { if (count($report) > 0) {
return true;//有约带看 return $report;//有约带看
}else{ }else{
return false;//无约带看 return [];//无约带看
} }
} }
......
...@@ -133,7 +133,7 @@ class UserLogService ...@@ -133,7 +133,7 @@ class UserLogService
#有约带看的客户显示 '约带看'标签 0:不显示 1:显示 #有约带看的客户显示 '约带看'标签 0:不显示 1:显示
$s_user_call = new UserCallStintService(); $s_user_call = new UserCallStintService();
$is_user_report = $s_user_call->isUserReport($user_id); $is_user_report = $s_user_call->isUserReport($user_id);
$data['is_user_report'] = $is_user_report; $data['is_user_report'] = $is_user_report ? 1 : 0;
return ["code" => 200, "data" => $data]; return ["code" => 200, "data" => $data];
} }
...@@ -280,7 +280,8 @@ class UserLogService ...@@ -280,7 +280,8 @@ class UserLogService
#有约带看的客户显示 '约带看'标签 0:不显示 1:显示 #有约带看的客户显示 '约带看'标签 0:不显示 1:显示
$s_user_call = new UserCallStintService(); $s_user_call = new UserCallStintService();
$is_user_report = $s_user_call->isUserReport($user_id); $is_user_report = $s_user_call->isUserReport($user_id);
$result['is_user_report'] = $is_user_report; $result['is_user_report'] = $is_user_report ? 1 : 0;
#拨打电话按钮是否显示 0:显示 1:不显示 #拨打电话按钮是否显示 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']);
...@@ -360,9 +361,10 @@ class UserLogService ...@@ -360,9 +361,10 @@ class UserLogService
{ {
#当天有约带看的客户 0:不显示 1:显示 #当天有约带看的客户 0:不显示 1:显示
$s_user_call = new UserCallStintService(); $s_user_call = new UserCallStintService();
$is_user_report = $s_user_call->isUserReport($user_id); $is_user_report = $s_user_call->isUserReport($user_id); date("Y-m-d H:i:s", strtotime("-1 hour"));
//3.3.9 如果有约带看 同时过保护期了 //3.3.9 如果有约带看 同时在约带看时间后2小时之前的
if ($is_user_report == 1 ) { $predict_see_time = strtotime ("+2 hour", strtotime($is_user_report[0]['predict_see_time']));
if ($is_user_report && (time() < $predict_see_time)) {
big_log('有约带看'); big_log('有约带看');
$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);
}else{ }else{
......
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