调整数据格式
Showing
1 changed file
with
2 additions
and
1 deletions
... | @@ -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'])) { | ... | ... |
-
Please register or sign in to post a comment