Commit 0afaaa85 0afaaa85c569d198c814a147cb1b5fc4554f0430 by lemon

调整数据格式

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