*
Showing
1 changed file
with
9 additions
and
1 deletions
| ... | @@ -17,9 +17,17 @@ class ReleaseSongService extends Service | ... | @@ -17,9 +17,17 @@ class ReleaseSongService extends Service |
| 17 | */ | 17 | */ |
| 18 | public function releaseSong() | 18 | public function releaseSong() |
| 19 | { | 19 | { |
| 20 | $res = SongsIp::query()->with('songsIpExt')->select(['id','song_id', 'name', 'singer', 'online_time']) | 20 | $res = SongsIp::query()->with(['songsIpExt:id,song_ip_id,track_cover'])->select(['id','song_id', 'edition']) |
| 21 | ->orderByDesc('online_time')->paginate($this->pageSize); | 21 | ->orderByDesc('online_time')->paginate($this->pageSize); |
| 22 | 22 | ||
| 23 | foreach ($res as &$item) { | ||
| 24 | |||
| 25 | $item->setAttribute('id', $item->id); | ||
| 26 | $item->setAttribute('name', $item->edition); | ||
| 27 | $item->setAttribute('cover', $item->songsIpExt ? $item->songsIpExt->track_cover : ''); | ||
| 28 | unset($item->songsIpExt, $item->edition, $item->song_id); | ||
| 29 | } | ||
| 30 | |||
| 23 | return Response::success($res); | 31 | return Response::success($res); |
| 24 | } | 32 | } |
| 25 | } | 33 | } | ... | ... |
-
Please register or sign in to post a comment