Commit 0afaaa85 0afaaa85c569d198c814a147cb1b5fc4554f0430 by lemon

调整数据格式

1 parent 89748c4e
...@@ -32,7 +32,7 @@ class MusicianSongService extends Service ...@@ -32,7 +32,7 @@ class MusicianSongService extends Service
32 $songip_table = SongsIp::table(); 32 $songip_table = SongsIp::table();
33 33
34 $res = Song::query()->join($songip_table, "{$song_table}.id", '=', "{$songip_table}.song_id") 34 $res = Song::query()->join($songip_table, "{$song_table}.id", '=', "{$songip_table}.song_id")
35 ->with(['contractDetail', 'coverResource'])->whereIn("{$songip_table}.song_id", $song_ids)->select(["{$song_table}.id", "{$songip_table}.id as sp_id", 'publish_song']) 35 ->with(['contractDetail', 'coverResource'])->whereIn("{$songip_table}.song_id", $song_ids)->select(["{$song_table}.id", "{$songip_table}.id as sp_id", 'online_time', 'publish_song'])
36 ->groupBy(["song_id"])->paginate($this->pageSize); 36 ->groupBy(["song_id"])->paginate($this->pageSize);
37 37
38 $sp_exts = []; 38 $sp_exts = [];
...@@ -48,6 +48,7 @@ class MusicianSongService extends Service ...@@ -48,6 +48,7 @@ class MusicianSongService extends Service
48 $item->setAttribute('singer', $singer); 48 $item->setAttribute('singer', $singer);
49 $item->setAttribute('cover', empty($item->coverResource) ? '' : $item->coverResource->url); 49 $item->setAttribute('cover', empty($item->coverResource) ? '' : $item->coverResource->url);
50 $item->setAttribute('ext', $sp_exts[$item->sp_id] ?? null); 50 $item->setAttribute('ext', $sp_exts[$item->sp_id] ?? null);
51 $item->setAttribute('online_time', $item->online_time);
51 52
52 $tmp = $item->toArray(); 53 $tmp = $item->toArray();
53 if (empty($tmp['contract_detail'])) { 54 if (empty($tmp['contract_detail'])) {
......