Commit ffcbfff7 ffcbfff734fcd8769390ea4fb522a34b9d0fe594 by lemon

*

1 parent 9da69faa
...@@ -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 }
......