合约地址
Showing
1 changed file
with
9 additions
and
3 deletions
... | @@ -3,6 +3,7 @@ | ... | @@ -3,6 +3,7 @@ |
3 | namespace App\Services; | 3 | namespace App\Services; |
4 | 4 | ||
5 | 5 | ||
6 | use App\Helper\CosHelper; | ||
6 | use App\Helper\Response; | 7 | use App\Helper\Response; |
7 | use App\Models\Legal\Contract; | 8 | use App\Models\Legal\Contract; |
8 | use App\Models\Legal\Song; | 9 | use App\Models\Legal\Song; |
... | @@ -123,8 +124,10 @@ class MusicianSongService extends Service | ... | @@ -123,8 +124,10 @@ class MusicianSongService extends Service |
123 | */ | 124 | */ |
124 | public function right($song_id) | 125 | public function right($song_id) |
125 | { | 126 | { |
127 | $client = new CosHelper(); | ||
128 | |||
126 | $res = SongStakeholder::query()->where('song_id', $song_id)->identify() | 129 | $res = SongStakeholder::query()->where('song_id', $song_id)->identify() |
127 | ->with(['contract:id,cooperation_type', 'contract.stakeholderContract', 'contract.files', 'contract.files.fileInfo:id,location']) | 130 | ->with(['contract:id,cooperation_type', 'contract.stakeholderContract', 'contract.files', 'contract.files.fileInfo:id,key']) |
128 | ->get()->toArray(); | 131 | ->get()->toArray(); |
129 | 132 | ||
130 | $contracts = []; | 133 | $contracts = []; |
... | @@ -135,9 +138,12 @@ class MusicianSongService extends Service | ... | @@ -135,9 +138,12 @@ class MusicianSongService extends Service |
135 | 138 | ||
136 | if (!empty($item['contract']['files'])) { | 139 | if (!empty($item['contract']['files'])) { |
137 | if ($file_info = array_column($item['contract']['files'], 'file_info')){ | 140 | if ($file_info = array_column($item['contract']['files'], 'file_info')){ |
138 | $files = array_column($file_info, 'location'); | 141 | $files = array_column($file_info, 'key'); |
139 | array_walk($files, function (&$location) { $location = env('resource_url'). $location; }); | 142 | } |
140 | } | 143 | } |
144 | |||
145 | foreach ($files as &$file) { | ||
146 | $file = $client->getPreviewUrl($file); | ||
141 | } | 147 | } |
142 | 148 | ||
143 | $right = $role = []; | 149 | $right = $role = []; | ... | ... |
-
Please register or sign in to post a comment