Commit 670073b7 authored by hujun's avatar hujun

下载录音路径修改

parent 6c9657b1
......@@ -639,6 +639,10 @@ class PrivacyNumber
$result = [$post_data];
}
if (empty($post_data['record_down'])) {
return json_encode(['code' => 1, 'msg' => '处理回调失败']);
}
foreach ($result as $k => $v) {
if (empty($v['call_id'])){
continue;
......@@ -648,19 +652,17 @@ class PrivacyNumber
continue;
}
if (empty($v['record_down'])) {
continue;
}
$where['call_id'] = $v['call_id'];
$where['call_time'] = date('Y-m-d H:i:s', $v['call_time']/1000);
$call_time = date('Y-m-d H:i:s', $v['call_time']/1000);
$where['call_time'] = $call_time;
//话单回调与录音回调两个值不一样
// $where['sub_id'] = (string)$v['subs_id'];
// $where[] = ['EXP', 'sub_id ="'.(string)$v['subs_id'].'"'];
try {
$secret_data = $m_secret_report->getFindData($filed_string, $where);
$result_data = PlsDemo::queryRecordFileDownloadUrl($v['call_id'], $v['call_time']);
if (empty($secret_data['voice_file'])){
$result_data = PlsDemo::queryRecordFileDownloadUrl($v['call_id'], $call_time);
}
} catch (\Exception $e) {
Log::write($e->getMessage(), 'voice_down_callBack_error'); //记录日志
return json_encode(['code' => 1, 'msg' => '处理回调失败']);
......@@ -669,7 +671,7 @@ class PrivacyNumber
if (isset($result_data->Message) && $result_data->Message == 'OK') {
$down_url = isset($result_data->DownloadUrl) ? explode('?', $result_data->DownloadUrl) : $result_data->DownloadUrl;
$file_name = basename($down_url[0]);
$is_down = down_file($result_data->DownloadUrl, PHONE_VOICE, $file_name, date('Y-m-d', strtotime($v['call_time'])));
$is_down = down_file($result_data->DownloadUrl, PHONE_VOICE, $file_name, date('Y-m-d', strtotime($call_time)));
if (file_exists($is_down)) {
$update_data[$k]['id'] = $secret_data['id'];
......
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