Commit 45441145 authored by hujun's avatar hujun

异常捕获

parent 84e113ad
......@@ -185,7 +185,7 @@ class CallPhoneService
}
if (!empty($call_phone['phone'])) {
$call_key = $this->phone_a.'-'.$call_phone['phone'].'_'.$this->phone_b.'_'.$this->is_privacy;
$call_key = $this->phone_a.'_'.$call_phone['phone'].'_'.$this->phone_b.'_'.$this->is_privacy;
$this->redis->set($call_key, $agent_id.'_'.$user_id.'_'.$user_type, $time_out);
}
......
......@@ -126,7 +126,7 @@ class BrokerService
$old_site_id = $m_district->getDistrictKeyById('site_id', ['id' => $agent_data['district_id']]);
$new_site_id = $m_district->getDistrictKeyById('site_id', ['id' => $data['district_id']]);
if ($old_site_id != $new_site_id && empty($data['confirm_old'])) {
if ($old_site_id != $new_site_id && $data['confirm_old'] != 1) {
$result['msg'] = '编辑部门,导致所属城市不一致';
return $result;
}
......
......@@ -91,6 +91,7 @@ class PrivacyNumber
*/
public function addReportV2()
{
try {
$post_data = Request::instance()->param();
$save_data_arr = $save_data = [];
foreach ($post_data as $k => $v) {
......@@ -98,12 +99,11 @@ class PrivacyNumber
$save_data['report_id'] = $v['id'];
unset($save_data['id']); //阿里大于返回是的id改为report_id
$info = $this->redis->get($v['phone_no'].'_'.$v['secret_no'].'_'.$v['peer_no'].'_0');
$info = $this->redis->get($v['phone_no'].'_'.$v['secret_no'].'_'.$v['peer_no'].'_1');
if (empty($info)) {
if ($v['phone_no']) {
$agent_where['phone'] = $v['phone_no'];
$agent_where['status'] = 0;
$agent_where['password'] = ['NOT NULL'];
$agent_id = $this->m_agent->getAgentsByWhere($agent_where, 'id');
if (empty($agent_id)) {
$phone_where['phone'] = $v['phone_no'];
......@@ -144,7 +144,11 @@ class PrivacyNumber
Log::write(json_encode($save_data), 'AliYunSecretReport'); //记录日志
}
$this->m_secret_report->insertDataAll($save_data_arr);
return json_encode(['code' => 0, 'msg' => '接收成功']);
$return = json_encode(['code' => 0, 'msg' => '接收成功']);
} catch (\Exception $e) {
$return = json_encode(['code' => "", 'msg' => $e->getMessage()]);
}
return $return;
}
/**
......@@ -312,6 +316,7 @@ class PrivacyNumber
*/
public function rongBilledInformUrl()
{
try {
$params = Request::instance()->param();
/*搜索A经纪人agent_id and B客户 user_id */
......@@ -343,7 +348,7 @@ class PrivacyNumber
'call_type' => $call_type,
];
$info = $this->redis->get($phone_a.'_'.$params['servingNum'].'_'.$phone_b.'_1');
$info = $this->redis->get($phone_a.'_'.$params['servingNum'].'_'.$phone_b.'_2');
if (empty($info)) {
if ($phone_a) {
$agent_where['phone'] = $phone_a;
......@@ -381,7 +386,11 @@ class PrivacyNumber
$m_service->saveCallNumByUserId($data['users_id']);
}
Log::write($str, 'rongBilledInformUrl'); //记录日志
return json_encode([ "statusCode" => '000000', 'msg' => '接收成功' ]);
$return = json_encode([ "statusCode" => '000000', 'msg' => '接收成功' ]);
} catch (\Exception $e) {
$return = json_encode([ "statusCode" => '', 'msg' => $e->getMessage() ]);
}
return $return;
}
/**
......
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