Commit 12fd5c4f by 杨昕

更改导出Excel格式

parent 3a87688b
Pipeline #14020 passed with stages
in 4 minutes 39 seconds
......@@ -27,7 +27,6 @@ class MediasExport implements WithHeadings,FromArray
'媒资编号',
'视频名称',
"永久播放地址",
"预览地址",
"全屏预览地址"
];
}
......
......@@ -271,11 +271,17 @@ class MediaController extends Controller
$file = $request->file('uploadFile');
#将文件内容转化为数组
$sheet = (new MediasImport)->toArray($file);
$sheet = (new MediasImport())->toCollection($file);
$media_ids = collect($sheet[0])->map(function ($item,$key){
return array_first($item);
})->toArray();
$data = [];
if (!empty($sheet[0])){
$media_ids = array_column($sheet[0],'media_id' );
#批量获取永久播放链接地址
$mediaInfos = MediaModel::batchGetMediaForverM3u8($request,$media_ids);
......
......@@ -1053,7 +1053,6 @@ class MediaModel extends Eloquent
$url = getenv('preview_domain')?getenv('preview_domain'):"https://xue.t.eoffcn.com/preview/temp/";
$item['preview_url'] = $url."play".'/'.$media_num;
$item['is_full_url'] = $url."player".'/'.$media_num;
}
......
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