Commit 5a02d1cd authored by hujun's avatar hujun

房东电话

parent 36fea835
......@@ -34,9 +34,10 @@ class CellPhone extends Basic
$call = new CallPhoneService($this->city, $this->siteId);
$record = true; //是否录音
$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'];
$landlord = empty($this->params['landlord']) ? 0: (int)$this->params['landlord'];
$result = $call->bindAXB($this->params['phone_a'], $this->params['phone_b'], $record, $user_id, $this->agentId, $this->agentName, $landlord, $house_id);
$type = empty($this->params['type']) ? 1: (int)$this->params['type'];
$result = $call->bindAXB($this->params['phone_a'], $this->params['phone_b'], $record, $user_id, $this->agentId, $this->agentName, $landlord, $type);
if ($result['status'] == 'success') {
$this->msg = $result['msg'];
......
......@@ -16,6 +16,8 @@ use app\index\service\UserLogService;
use app\model\AliYunPhone;
use app\model\BindingPhone;
use app\model\AliYunSecretReport;
use app\model\GLandlordPhone;
use app\model\OfficeGRoom;
use app\model\SecretReport;
use app\model\UPhoneFollowUp;
use app\model\UPhoneFollowUpTemporary;
......@@ -72,10 +74,10 @@ class CallPhoneService
* @param int $agent_id
* @param string $agent_name
* @param int $landlord
* @param int $house_id
* @param int $type
* @return mixed
*/
public function bindAXB($phone_a, $phone_b, $record = true, int $user_id, $agent_id, string $agent_name, int $landlord, int $house_id)
public function bindAXB($phone_a, $phone_b, $record = true, int $user_id, $agent_id, string $agent_name, int $landlord, int $type)
{
$result['status'] = 'failed';
$type = '';
......@@ -83,17 +85,24 @@ class CallPhoneService
$result['msg'] = '本机号码格式错误,请重新编辑!';
return $result;
}
if (!empty($user_id)) {
$this->user_id = $user_id;
$user_data = $this->getUserDataV2();
if (empty($user_data['user_phone'])) {
$result['status'] = 'fail';
$result['msg'] = '没有用户信息';
return $result;
if ($landlord) {
if ($type == 1) {
$phone_b = $this->getHouseLandlordPhone($user_id); //商铺房东手机号
} else {
$phone_b = $this->getBuildingRoomLandlordPhone($user_id); //楼盘房源房东手机号
}
} else {
$this->user_id = $user_id;
$user_data = $this->getUserDataV2();
if (empty($user_data['user_phone'])) {
$result['status'] = 'fail';
$result['msg'] = '没有用户信息';
return $result;
}
$phone_b = $user_data['user_phone'];
}
$phone_b = $user_data['user_phone'];
}
if (empty($phone_a) || strlen($phone_a) != 11) {
......@@ -697,4 +706,28 @@ class CallPhoneService
}
return $result;
}
/**
* 商铺房东手机号
*
* @param $id
* @return array
*/
public function getHouseLandlordPhone($id)
{
$m_landlord = new GLandlordPhone();
return $m_landlord->getValue('phone', ['id'=>$id]);
}
/**
* 楼盘房源房东手机号
*
* @param $id
* @return mixed
*/
public function getBuildingRoomLandlordPhone($id)
{
$m_landlord = new OfficeGRoom();
return $m_landlord->getFieldOneValue('phone', ['id'=>$id]);
}
}
\ No newline at end of file
......@@ -291,11 +291,13 @@ class CellPhone extends Basic
$phone_b = $this->params['phone_b'];
}
$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'];
$type = empty($this->params['type']) ? 0: (int)$this->params['type'];
$record = true; //录音
$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, $type);
$result['msg'] = '';
if ($data['status'] == 'success') {
// $push = new PushMessageService();
......
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