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
92bb410c
...
92bb410c8587f8f74452e65b4c5ab029ae60482a
authored
2022-12-29 11:06:53 +0800
by
lemon
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
获取发行最新记录
1 parent
19802215
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
app/Models/Legal/SongsApply.php
app/Services/IssueService.php
app/Models/Legal/SongsApply.php
View file @
92bb410
...
...
@@ -31,6 +31,6 @@ class SongsApply extends BaseModel
*/
public
function
songs_album
()
{
return
$this
->
belongsTo
(
SongsIssueAlbum
::
class
,
'album_id'
,
'id'
)
->
select
(
'id'
,
'album_name'
,
'ver'
,
'singer'
,
'submit_at'
,
'operator'
)
;
return
$this
->
belongsTo
(
SongsIssueAlbum
::
class
,
'album_id'
,
'id'
);
}
}
...
...
app/Services/IssueService.php
View file @
92bb410
...
...
@@ -80,15 +80,17 @@ class IssueService extends Service
public
function
latestOnlineRecord
()
{
$res
=
SongsApply
::
query
()
->
where
([
'from'
=>
1
,
'user_id'
=>
$this
->
request
->
get
(
'identifier'
)
->
company_id
])
->
whereNotNull
(
'qy_url'
)
->
with
(
'songs_album.cover:link_id,key'
)
->
select
([
'name'
,
'album_id'
,
'singer'
,
'issue_time'
,
'qy_url'
])
->
paginate
(
$this
->
pageSize
);
->
whereNotNull
(
'qy_url'
)
->
with
([
'songs_album:id,cover_map_id'
,
'songs_album.cover:id,link_id,key'
])
->
select
([
'name'
,
'album_id'
,
'singer'
,
'online_time'
,
'qy_url'
])
->
orderByDesc
(
'online_time'
)
->
paginate
(
$this
->
pageSize
);
$cos
=
new
CosHelper
(
env
(
'MATERIAL_BUCKET'
));
foreach
(
$res
as
&
$item
)
{
if
(
!
empty
(
$item
->
songs_album
))
{
if
(
!
empty
(
$item
->
songs_album
->
cover
))
{
$item
->
cover
=
$cos
->
getPreviewUrl
(
$item
->
songs_album
->
cover
->
key
);
}
unset
(
$item
->
songs_album
);
}
return
Response
::
success
(
$res
);
...
...
Please
register
or
sign in
to post a comment