Commit 87f518a0 authored by hujun's avatar hujun

录音下载修改

parent 89e173ce
...@@ -62,7 +62,7 @@ class PrivacyNumber ...@@ -62,7 +62,7 @@ class PrivacyNumber
$result_data = PlsDemo::queryRecordFileDownloadUrl($v['call_id'], $v['call_time']); $result_data = PlsDemo::queryRecordFileDownloadUrl($v['call_id'], $v['call_time']);
if ($result_data->Message == 'OK') { if ($result_data->Message == 'OK') {
$down_url = explode('?',$result_data->DownloadUrl); $down_url = explode('?',$result_data->DownloadUrl);
$is_down = down_file($down_url[0], ROOT_PATH.'public'.DS.'static'.DS.'voice',basename($down_url[0])); $is_down = down_file($result_data->DownloadUrl, ROOT_PATH.'public'.DS.'static'.DS.'voice',basename($down_url[0]));
if (file_exists($is_down)) { if (file_exists($is_down)) {
$data['id'] = $v['id']; $data['id'] = $v['id'];
...@@ -74,20 +74,20 @@ class PrivacyNumber ...@@ -74,20 +74,20 @@ class PrivacyNumber
} }
/*容联云音频下载*/ /*容联云音频下载*/
$rongRecord = new RongBilledInform(); $rongRecord = new RongBilledInform();
$ids=array(); $ids = [];
$field='id,voice_file'; $field = 'id,mp3_url';
$where='record_down=0'; $where = 'download=0';
$down_data2=$rongRecord->getArr($field,$where); $down_data2 = $rongRecord->getArr($field,$where);
if($down_data2) { if($down_data2) {
foreach ($down_data2 as $k => $v) { foreach ($down_data2 as $k => $v) {
$ids[] = $v['id']; $ids[] = $v['id'];
$down_url2 = explode('/', $v['voice_file']); $down_url2 = explode('/', $v['mp3_url']);
down_file($v['voice_file'], ROOT_PATH . 'public' . DS . 'static' . DS . 'voice', array_pop($down_url2)); down_file($v['mp3_url'], ROOT_PATH . 'public' . DS . 'static' . DS . 'voice', array_pop($down_url2));
} }
} }
$id_str=implode(',',$ids); $id_str = implode(',',$ids);
$update['record_down']=1; $update['download'] = 1;
$where=" id in($id_str)"; $where = " id in($id_str)";
$rongRecord->save($update,$where); $rongRecord->save($update,$where);
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