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
aa6e37de
Commit
aa6e37de
authored
Aug 20, 2020
by
杨昕
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sfd
parent
7ef91170
Pipeline
#10753
passed with stages
in 40 seconds
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
5 deletions
+19
-5
MediaController.php
app/Http/Controllers/Api/MediaController.php
+9
-1
MediaModel.php
app/Model/MediaModel.php
+10
-4
No files found.
app/Http/Controllers/Api/MediaController.php
View file @
aa6e37de
...
...
@@ -126,6 +126,7 @@ class MediaController extends Controller
'description'
=>
''
,
'duration'
=>
''
,
'media_type'
=>
''
,
'shop_id'
=>
''
,
]));
$data_time
=
Carbon
::
now
();
...
...
@@ -133,12 +134,19 @@ class MediaController extends Controller
$params
=
array
(
'media_id'
=>
'mda-'
.
generateRandomNum
(
16
),
'media_type'
=>
'5efa9cb5d16f5a214671fd86'
,
'start_time'
=>
$data_time
,
'end_time'
=>
$data_time
,
'access_key'
=>
''
,
'description'
=>
''
,
'description'
=>
$request
->
description
??
''
,
);
if
(
$request
->
shop_id
==
'100'
){
$params
[
'media_type'
]
=
"5f3d073a033f5a336b2b4346"
;
}
$request
->
replace
(
array_merge
(
$request
->
all
(),
$params
));
$id
=
MediaModel
::
hookRestoreMedia
(
$request
);
...
...
app/Model/MediaModel.php
View file @
aa6e37de
...
...
@@ -176,7 +176,10 @@ class MediaModel extends Eloquent
$media_info
=
explode
(
"&"
,
$request
->
media_name
);
$mediaCatg
=
MediaCategoryModel
::
where
(
'_id'
,
$request
->
media_type
)
->
first
();
$media_type
=
$request
->
media_type
;
$mediaCatg
=
MediaCategoryModel
::
where
(
'_id'
,
$media_type
)
->
first
();
if
(
empty
(
$mediaCatg
)){
throw
new
\Exception
(
"媒资类别不存在"
);
}
...
...
@@ -199,9 +202,9 @@ class MediaModel extends Eloquent
if
(
$request
->
shop_id
==
'100'
){
$mediaCatg
=
MediaCategoryModel
::
where
(
'_id'
,
'5f3d073a033f5a336b2b4346'
)
->
first
();
}
//
if ($request->shop_id=='100'){
//
$mediaCatg = MediaCategoryModel::where('_id','5f3d073a033f5a336b2b4346')->first();
//
}
/**
...
...
@@ -708,4 +711,7 @@ class MediaModel extends Eloquent
}
}
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