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
a4117c08
...
a4117c085c8fb5239d0b81fb700ed6e5b178aad8
authored
2021-09-18 16:43:03 +0800
by
lemon
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
首发专辑
1 parent
ffcbfff7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
10 deletions
app/Services/ReleaseSongService.php
app/Services/ReleaseSongService.php
View file @
a4117c0
...
...
@@ -17,16 +17,10 @@ class ReleaseSongService extends Service
*/
public
function
releaseSong
()
{
$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
);
}
$res
=
SongsIp
::
query
()
->
where
(
'online_time'
,
'<='
,
now
()
->
toDateTimeString
())
->
select
([
'songs_ip.id'
,
'edition as name'
,
'track_cover as cover'
])
->
join
(
'songs_ip_exts as six'
,
'songs_ip.song_id'
,
'='
,
'six.song_ip_id'
)
->
orderByDesc
(
'online_time'
)
->
groupBy
(
'edition'
)
->
paginate
(
$this
->
pageSize
);
return
Response
::
success
(
$res
);
}
...
...
Please
register
or
sign in
to post a comment