Commit e7fb4ba5 authored by hujun's avatar hujun

打电话默认跟进

parent 5836ffc1
...@@ -31,7 +31,7 @@ class CellPhone extends Basic ...@@ -31,7 +31,7 @@ class CellPhone extends Basic
header('Access-Control-Allow-Origin:*'); header('Access-Control-Allow-Origin:*');
$call = new CallPhoneService($this->city); $call = new CallPhoneService($this->city, $this->siteId);
$record = true; //是否录音 $record = true; //是否录音
$user_id = empty($this->params['user_id']) ? 0:(int)$this->params['user_id']; $user_id = empty($this->params['user_id']) ? 0:(int)$this->params['user_id'];
$house_id = empty($this->params['house_id']) ? 0:(int)$this->params['house_id']; $house_id = empty($this->params['house_id']) ? 0:(int)$this->params['house_id'];
......
...@@ -39,8 +39,9 @@ class CallPhoneService ...@@ -39,8 +39,9 @@ class CallPhoneService
private $city; private $city;
public $redis; public $redis;
private $m_bind; private $m_bind;
private $site_id;
public function __construct(string $city = '上海市') public function __construct(string $city = '上海市', int $site_id = 10001)
{ {
$this->city = substr($city, 0, strpos($city, '市')); //去市 $this->city = substr($city, 0, strpos($city, '市')); //去市
$this->redis = RedisExt::getRedis(); $this->redis = RedisExt::getRedis();
...@@ -52,6 +53,7 @@ class CallPhoneService ...@@ -52,6 +53,7 @@ class CallPhoneService
$this->day_num = empty($this->day_num) ? 1 : $this->day_num + 1; $this->day_num = empty($this->day_num) ? 1 : $this->day_num + 1;
$this->landlord_phone_day = empty($this->landlord_phone_day) ? 1 : $this->landlord_phone_day + 1; $this->landlord_phone_day = empty($this->landlord_phone_day) ? 1 : $this->landlord_phone_day + 1;
$this->m_bind = new BindingPhone(); $this->m_bind = new BindingPhone();
$this->site_id = $site_id;
} }
/** /**
...@@ -547,13 +549,12 @@ class CallPhoneService ...@@ -547,13 +549,12 @@ class CallPhoneService
$follow_where['agent_id'] = $array[0]; $follow_where['agent_id'] = $array[0];
$follow_where['user_id'] = $array[1]; $follow_where['user_id'] = $array[1];
if(isset($array[2])){ if(isset($array[2])){
$follow_where['site_id'] = $array[2]; $site_id = $array[2];
}else{ }else{
$follow_where['site_id'] = "10001"; $site_id = '10001';
} }
$m_follow_up = new UPhoneFollowPp($follow_where['site_id']); $m_follow_up = new UPhoneFollowPp($site_id);
$num = $m_follow_up->getFollowTotal($follow_where); $num = $m_follow_up->getFollowTotal($follow_where);
if (empty($num) && !empty($array[1])) { if (empty($num) && !empty($array[1])) {
//$agent_id, $user_id, $content, $type //$agent_id, $user_id, $content, $type
$m_follow_up->insertDefaultFollow($array[0], $array[1], $content, 0); $m_follow_up->insertDefaultFollow($array[0], $array[1], $content, 0);
...@@ -585,7 +586,7 @@ class CallPhoneService ...@@ -585,7 +586,7 @@ class CallPhoneService
} }
if ($user_type == 1) { if ($user_type == 1) {
$this->redis->hSet($key, $agent_id . '-' . $user_id, time()); $this->redis->hSet($key, $agent_id . '-' . $user_id. '-'. $this->site_id, time());
} else { } else {
$this->redis->hSet($key, $agent_id . '-' . $user_id . '-' . $phone_a . '-' . $phone_b, time()); $this->redis->hSet($key, $agent_id . '-' . $user_id . '-' . $phone_a . '-' . $phone_b, time());
} }
......
...@@ -275,7 +275,7 @@ class CellPhone extends Basic ...@@ -275,7 +275,7 @@ class CellPhone extends Basic
$house_id = empty($this->params['house_id']) ? 0:(int)$this->params['house_id']; $house_id = empty($this->params['house_id']) ? 0:(int)$this->params['house_id'];
$landlord = empty($this->params['landlord']) ? 0: (int)$this->params['landlord']; $landlord = empty($this->params['landlord']) ? 0: (int)$this->params['landlord'];
$record = true; //录音 $record = true; //录音
$call_phone = new CallPhoneService($this->city); $call_phone = new CallPhoneService($this->city, $this->siteId);
$data = $call_phone->bindAXB($this->params['phone_a'], $phone_b, $record, $user_id, $this->userId, $this->userName, $landlord, $house_id); $data = $call_phone->bindAXB($this->params['phone_a'], $phone_b, $record, $user_id, $this->userId, $this->userName, $landlord, $house_id);
$result['msg'] = ''; $result['msg'] = '';
if ($data['status'] == 'success') { if ($data['status'] == 'success') {
......
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