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
9bca32d3
Commit
9bca32d3
authored
Apr 06, 2021
by
杨昕
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
按照指定顺序导出表格
parent
ee0235af
Pipeline
#14117
passed with stages
in 2 minutes 59 seconds
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
18 deletions
+10
-18
MediaController.php
app/Http/Controllers/Web/MediaController.php
+1
-1
MediaModel.php
app/Model/MediaModel.php
+9
-17
No files found.
app/Http/Controllers/Web/MediaController.php
View file @
9bca32d3
...
...
@@ -340,7 +340,7 @@ class MediaController extends Controller
$content
=
json_decode
(
$record
[
'content'
],
true
);
DownloadRecord
::
delRecord
(
$keyId
);
//
DownloadRecord::delRecord($keyId);
return
new
MediasExport
(
$content
);
...
...
app/Model/MediaModel.php
View file @
9bca32d3
...
...
@@ -1047,12 +1047,11 @@ class MediaModel extends Eloquent
private
static
function
mediaExportFormat
(
array
$data
,
$orginal_data
){
foreach
(
$orginal_data
as
$key
=>
&
$item
){
foreach
(
$data
as
$key
=>
&
$item
){
if
(
empty
(
$item
)){
$item
[
'_id'
]
=
$key
;
if
(
empty
(
$data
[
$key
])){
$item
[
'id'
]
=
$key
;
$item
[
'media_name'
]
=
'未查到相关数据'
;
$item
[
'forvery_url'
]
=
'未查到相关数据'
;
$item
[
'is_full_url'
]
=
"未查到相关数据"
;
...
...
@@ -1060,34 +1059,27 @@ class MediaModel extends Eloquent
}
else
{
$media
=
MediaModel
::
select
(
'media_name'
)
->
where
(
'_id'
,
$item
[
'id'
])
->
first
();
$media_id
=
$item
[
'media_id'
];
$media
=
MediaModel
::
select
(
'media_name'
)
->
where
(
'_id'
,
$media_id
)
->
first
();
$media_id
=
$item
[
'id'
];
$media_num
=
md5
(
md5
(
$media_id
));
$item
[
'_id'
]
=
$item
[
'id'
];
$item
[
'media_name'
]
=
$media
[
'media_name'
];
$item
[
'name'
]
=
$orginal_data
[
$item
[
'_id'
]][
'name'
];
$tmp
=
[
'media_num'
=>
$media_num
,
];
MediaModel
::
where
(
"_id"
,
$media_id
)
->
update
(
$tmp
);
$url
=
getenv
(
'preview_domain'
)
?
getenv
(
'preview_domain'
)
:
"https://xue.t.eoffcn.com/preview/temp/"
;
$item
[
'forvery_url'
]
=
$
item
[
'url'
];
$item
[
'forvery_url'
]
=
$
data
[
$key
]
[
'url'
];
$item
[
'is_full_url'
]
=
$url
.
"player"
.
'/'
.
$media_num
;
$item
[
'name'
]
=
$orginal_data
[
$media_id
][
'name'
];
unset
(
$item
[
'id'
]);
unset
(
$item
[
'key'
]);
unset
(
$item
[
'status'
]);
unset
(
$item
[
'url'
]);
}
}
return
$data
;
return
$
orginal_
data
;
}
}
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