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
ffcbfff7
...
ffcbfff734fcd8769390ea4fb522a34b9d0fe594
authored
2021-09-18 15:28:04 +0800
by
lemon
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
*
1 parent
9da69faa
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletions
app/Services/ReleaseSongService.php
app/Services/ReleaseSongService.php
View file @
ffcbfff
...
...
@@ -17,9 +17,17 @@ class ReleaseSongService extends Service
*/
public
function
releaseSong
()
{
$res
=
SongsIp
::
query
()
->
with
(
'songsIpExt'
)
->
select
([
'id'
,
'song_id'
,
'name'
,
'singer'
,
'online_time
'
])
$res
=
SongsIp
::
query
()
->
with
(
[
'songsIpExt:id,song_ip_id,track_cover'
])
->
select
([
'id'
,
'song_id'
,
'edition
'
])
->
orderByDesc
(
'online_time'
)
->
paginate
(
$this
->
pageSize
);
foreach
(
$res
as
&
$item
)
{
$item
->
setAttribute
(
'id'
,
$item
->
id
);
$item
->
setAttribute
(
'name'
,
$item
->
edition
);
$item
->
setAttribute
(
'cover'
,
$item
->
songsIpExt
?
$item
->
songsIpExt
->
track_cover
:
''
);
unset
(
$item
->
songsIpExt
,
$item
->
edition
,
$item
->
song_id
);
}
return
Response
::
success
(
$res
);
}
}
...
...
Please
register
or
sign in
to post a comment