Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
media-resource
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
杨昕
media-resource
Commits
fdc5adc3
Commit
fdc5adc3
authored
Apr 06, 2021
by
杨昕
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
多个sheet 默认处理有数据的第一个sheet
parent
97ec5572
Pipeline
#14121
passed with stages
in 3 minutes 20 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
3 deletions
+12
-3
MediaController.php
app/Http/Controllers/Web/MediaController.php
+12
-3
No files found.
app/Http/Controllers/Web/MediaController.php
View file @
fdc5adc3
...
@@ -284,11 +284,20 @@ class MediaController extends Controller
...
@@ -284,11 +284,20 @@ class MediaController extends Controller
#将文件内容转化为数组
#将文件内容转化为数组
$sheet
=
(
new
MediasImport
())
->
toArray
(
$file
);
$sheet
=
(
new
MediasImport
())
->
toArray
(
$file
);
$orginal_data
=
null
;
foreach
(
$sheet
as
$k
=>
$v
){
if
(
!
empty
(
$v
)){
$orginal_data
=
$v
;
break
;
}
}
if
(
empty
(
$orginal_data
)){
throw
new
\Exception
(
"文件格式有误"
);
}
$temp
=
[];
$temp
=
[];
foreach
(
$
sheet
[
0
]
as
$key
=>
$item
){
foreach
(
$
orginal_data
as
$key
=>
$item
){
if
(
!
isset
(
$item
[
"媒资编号"
])
||
!
isset
(
$item
[
"名称"
])){
if
(
!
isset
(
$item
[
"媒资编号"
])
||
!
isset
(
$item
[
"名称"
])){
throw
new
\Exception
(
"文件格式有误"
);
throw
new
\Exception
(
"文件格式有误"
);
...
@@ -301,7 +310,7 @@ class MediaController extends Controller
...
@@ -301,7 +310,7 @@ class MediaController extends Controller
}
}
$data
=
[];
$data
=
[];
if
(
!
empty
(
$
sheet
[
0
]
)){
if
(
!
empty
(
$
orginal_data
)){
#批量获取永久播放链接地址
#批量获取永久播放链接地址
$mediaInfos
=
MediaModel
::
batchGetMediaForverM3u8
(
$request
,
$temp
);
$mediaInfos
=
MediaModel
::
batchGetMediaForverM3u8
(
$request
,
$temp
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment