Commit 4d3aea91 authored by hujun's avatar hujun

根据成交报告id查询经纪人

parent a226032d
...@@ -1346,4 +1346,24 @@ class OfficeBargain extends Basic ...@@ -1346,4 +1346,24 @@ class OfficeBargain extends Basic
} }
return $this->response($data['code'], $data['msg'], $data['data']); return $this->response($data['code'], $data['msg'], $data['data']);
} }
/**
* 根据成交报告id查询经纪人
* 1盘方,2客方,3反签,4独家,5合作方
*
*
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function searchBargainAgents()
{
if (empty($this->params['bargain_id'])) {
return $this->response(101, '请求参数错误!');
}
$data = $this->m_bargain->getAgentTypeByBargainId($this->params['bargain_id']);
return $this->response(200, "", $data);
}
} }
\ No newline at end of file
<?php
namespace app\model;
use think\Db;
class AliyunVoiceDown extends BaseModel
{
protected $table = 'office_g_room';
private $db_;
public function __construct($data = [])
{
parent::__construct($data);
$this->db_ = Db::name($this->table);
}
/**
* @param $data
* @return int|string
*/
public function insertAllData($data)
{
return $this->db_->insertAll($data);
}
}
\ No newline at end of file
...@@ -664,6 +664,7 @@ Route::group('task', [ ...@@ -664,6 +664,7 @@ Route::group('task', [
'rongStatusInformUrl' => ['task/PrivacyNumber/rongStatusInformUrl', ['method' => 'post | get']],//隐私号码回调[状态通知] 'rongStatusInformUrl' => ['task/PrivacyNumber/rongStatusInformUrl', ['method' => 'post | get']],//隐私号码回调[状态通知]
'defaultFollowUp' => ['task/PrivacyNumber/defaultFollowUp', ['method' => 'post | get']], //默认跟进 'defaultFollowUp' => ['task/PrivacyNumber/defaultFollowUp', ['method' => 'post | get']], //默认跟进
'callBackDownVoice' => ['task/PrivacyNumber/callBackDownVoice', ['method' => 'post | get']], //回调录音 'callBackDownVoice' => ['task/PrivacyNumber/callBackDownVoice', ['method' => 'post | get']], //回调录音
'getDownVoiceParams' => ['task/PrivacyNumber/getDownVoiceParams', ['method' => 'post | get']], //回调录音
'updateShopTask' => ['task/JobTask/updateShopTask', ['method' => 'post | get']], //默认跟进 'updateShopTask' => ['task/JobTask/updateShopTask', ['method' => 'post | get']], //默认跟进
...@@ -1080,6 +1081,7 @@ Route::group('office_index', [ ...@@ -1080,6 +1081,7 @@ Route::group('office_index', [
'checkBackOutOne/:check_status' => ['index/OfficeBargain/checkReport', ['method' => 'post'], ['check_status' => 1]], //审核撤销成交报告-第一级审核 'checkBackOutOne/:check_status' => ['index/OfficeBargain/checkReport', ['method' => 'post'], ['check_status' => 1]], //审核撤销成交报告-第一级审核
'checkBackOutTwo/:check_status' => ['index/OfficeBargain/checkReport', ['method' => 'post'], ['check_status' => 2]], //审核撤销成交报告-第二级审核 'checkBackOutTwo/:check_status' => ['index/OfficeBargain/checkReport', ['method' => 'post'], ['check_status' => 2]], //审核撤销成交报告-第二级审核
'checkBackOutThree/:check_status' => ['index/OfficeBargain/checkReport', ['method' => 'post'], ['check_status' => 3]], //审核撤销成交报告-第三级审核 'checkBackOutThree/:check_status' => ['index/OfficeBargain/checkReport', ['method' => 'post'], ['check_status' => 3]], //审核撤销成交报告-第三级审核
'searchBargainAgents' => ['index/OfficeBargain/searchBargainAgents', ['method' => 'GET']], //成交报告id获取盘方,客方,反签,独家,合作方
'collectingBill' => ['index/officePayLog/collectingBill', ['method' => 'get|post']], //收款 'collectingBill' => ['index/officePayLog/collectingBill', ['method' => 'get|post']], //收款
'getBeForNum' => ['index/officePayLog/getBeForNum', ['method' => 'get']],//获取上次提交收款的门牌号等 'getBeForNum' => ['index/officePayLog/getBeForNum', ['method' => 'get']],//获取上次提交收款的门牌号等
......
...@@ -17,12 +17,14 @@ use app\extra\RedisExt; ...@@ -17,12 +17,14 @@ use app\extra\RedisExt;
use app\model\AAgents; use app\model\AAgents;
use app\model\AAgentsPhone; use app\model\AAgentsPhone;
use app\model\AliYunSecretReport; use app\model\AliYunSecretReport;
use app\model\AliyunVoiceDown;
use app\model\BindingPhone; use app\model\BindingPhone;
use app\model\GLandlordPhone; use app\model\GLandlordPhone;
use app\model\TAgentTotalCallModel; use app\model\TAgentTotalCallModel;
use app\model\Users; use app\model\Users;
use think\Log; use think\Log;
use think\Request; use think\Request;
use think\Response;
class PrivacyNumber class PrivacyNumber
{ {
...@@ -32,6 +34,7 @@ class PrivacyNumber ...@@ -32,6 +34,7 @@ class PrivacyNumber
private $m_agent; private $m_agent;
private $m_agent_phone; private $m_agent_phone;
private $m_user; private $m_user;
private $m_down;
public function __construct() public function __construct()
{ {
$this->redis = RedisExt::getRedis(); $this->redis = RedisExt::getRedis();
...@@ -40,6 +43,7 @@ class PrivacyNumber ...@@ -40,6 +43,7 @@ class PrivacyNumber
$this->m_agent = new AAgents(); $this->m_agent = new AAgents();
$this->m_agent_phone = new AAgentsPhone(); $this->m_agent_phone = new AAgentsPhone();
$this->m_user = new Users(); $this->m_user = new Users();
$this->m_down = new AliyunVoiceDown();
} }
/** /**
...@@ -51,7 +55,7 @@ class PrivacyNumber ...@@ -51,7 +55,7 @@ class PrivacyNumber
{ {
try { try {
$post_data = Request::instance()->param(); $post_data = Request::instance()->param();
$save_data_arr = $save_data = []; $save_data_arr = $save_data = $down_array = [];
foreach ($post_data as $k => $v) { foreach ($post_data as $k => $v) {
$save_data = $v; $save_data = $v;
if (isset($v['id'])) { if (isset($v['id'])) {
...@@ -103,12 +107,22 @@ class PrivacyNumber ...@@ -103,12 +107,22 @@ class PrivacyNumber
$m_service = new ClientService(); $m_service = new ClientService();
$m_service->saveCallNumByUserId($save_data['users_id']); $m_service->saveCallNumByUserId($save_data['users_id']);
} }
$down_array[$k] = [
'call_id' => $v['call_id'],
'call_time' => $v['call_time'],
'type' => 1,
];
} }
$save_data_arr[] = $save_data; $save_data_arr[] = $save_data;
Log::write(json_encode($save_data), 'AliYunSecretReport'); //记录日志 Log::write(json_encode($save_data), 'AliYunSecretReport'); //记录日志
} }
$this->m_secret_report->insertDataAll($save_data_arr); $this->m_secret_report->insertDataAll($save_data_arr);
if (!empty($down_array)) {
$this->m_down->insertAllData($down_array); //录音下载
}
$return = json_encode(['code' => 0, 'msg' => '接收成功']); $return = json_encode(['code' => 0, 'msg' => '接收成功']);
} catch (\Exception $e) { } catch (\Exception $e) {
$return = json_encode(['code' => "", 'msg' => $e->getMessage()]); $return = json_encode(['code' => "", 'msg' => $e->getMessage()]);
...@@ -395,6 +409,14 @@ class PrivacyNumber ...@@ -395,6 +409,14 @@ class PrivacyNumber
$where['call_id'] = $params['callId']; $where['call_id'] = $params['callId'];
$update['mp3_url'] = $params['recordUrl']; $update['mp3_url'] = $params['recordUrl'];
$this->m_secret_report->editData($update, $params['callId'], 'call_id'); $this->m_secret_report->editData($update, $params['callId'], 'call_id');
$down_array = [
'call_id' => $params['callId'],
'mp3_url' => $params['recordUrl'],
'type' => 2,
];
$this->m_down->insertAllData($down_array);
$str = date('Y-m-d h:i:s') . ' 容联云录音' . var_export($params, true); $str = date('Y-m-d h:i:s') . ' 容联云录音' . var_export($params, true);
Log::write($str, 'rongRecordingInformUrl'); //记录日志 Log::write($str, 'rongRecordingInformUrl'); //记录日志
return json_encode([ "statusCode" => '000000', 'msg' => '接收成功' ]); return json_encode([ "statusCode" => '000000', 'msg' => '接收成功' ]);
...@@ -681,4 +703,13 @@ class PrivacyNumber ...@@ -681,4 +703,13 @@ class PrivacyNumber
return $return; return $return;
} }
public function getDownVoiceParams()
{
$params = Request::instance()->param();
if (!in_array($params['source'], [1,2])) {
Response::create(['code'=>101, 'msg'=>'参数错误'], 'json');
}
}
} }
\ No newline at end of file
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