Commit 7ab4b25a 7ab4b25abb5c646f40635066117cc43cb8ee43ef by lemon

合约地址

1 parent e325b426
...@@ -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,11 +138,14 @@ class MusicianSongService extends Service ...@@ -135,11 +138,14 @@ 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; });
140 } 142 }
141 } 143 }
142 144
145 foreach ($files as &$file) {
146 $file = $client->getPreviewUrl($file);
147 }
148
143 $right = $role = []; 149 $right = $role = [];
144 if (!empty($item['contract']['stakeholder_contract'])) { 150 if (!empty($item['contract']['stakeholder_contract'])) {
145 foreach ($item['contract']['stakeholder_contract'] as $stakeholder_contract) { 151 foreach ($item['contract']['stakeholder_contract'] as $stakeholder_contract) {
......