Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Cong.Zhao
/
musician-api.hikoon.com
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
7ab4b25a
...
7ab4b25abb5c646f40635066117cc43cb8ee43ef
authored
2021-11-15 17:41:55 +0800
by
lemon
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
合约地址
1 parent
e325b426
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
app/Services/MusicianSongService.php
app/Services/MusicianSongService.php
View file @
7ab4b25
...
...
@@ -3,6 +3,7 @@
namespace
App\Services
;
use
App\Helper\CosHelper
;
use
App\Helper\Response
;
use
App\Models\Legal\Contract
;
use
App\Models\Legal\Song
;
...
...
@@ -123,8 +124,10 @@ class MusicianSongService extends Service
*/
public
function
right
(
$song_id
)
{
$client
=
new
CosHelper
();
$res
=
SongStakeholder
::
query
()
->
where
(
'song_id'
,
$song_id
)
->
identify
()
->
with
([
'contract:id,cooperation_type'
,
'contract.stakeholderContract'
,
'contract.files'
,
'contract.files.fileInfo:id,
location
'
])
->
with
([
'contract:id,cooperation_type'
,
'contract.stakeholderContract'
,
'contract.files'
,
'contract.files.fileInfo:id,
key
'
])
->
get
()
->
toArray
();
$contracts
=
[];
...
...
@@ -135,9 +138,12 @@ class MusicianSongService extends Service
if
(
!
empty
(
$item
[
'contract'
][
'files'
]))
{
if
(
$file_info
=
array_column
(
$item
[
'contract'
][
'files'
],
'file_info'
)){
$files
=
array_column
(
$file_info
,
'
location
'
);
array_walk
(
$files
,
function
(
&
$location
)
{
$location
=
env
(
'resource_url'
)
.
$location
;
});
$files
=
array_column
(
$file_info
,
'
key
'
);
}
}
foreach
(
$files
as
&
$file
)
{
$file
=
$client
->
getPreviewUrl
(
$file
);
}
$right
=
$role
=
[];
...
...
Please
register
or
sign in
to post a comment