Commit 7ab4b25a 7ab4b25abb5c646f40635066117cc43cb8ee43ef by lemon

合约地址

1 parent e325b426
......@@ -3,6 +3,7 @@
namespace App\Services;
use App\Helper\CosHelper;
use App\Helper\Response;
use App\Models\Legal\Contract;
use App\Models\Legal\Song;
......@@ -123,8 +124,10 @@ class MusicianSongService extends Service
*/
public function right($song_id)
{
$client = new CosHelper();
$res = SongStakeholder::query()->where('song_id', $song_id)->identify()
->with(['contract:id,cooperation_type', 'contract.stakeholderContract', 'contract.files', 'contract.files.fileInfo:id,location'])
->with(['contract:id,cooperation_type', 'contract.stakeholderContract', 'contract.files', 'contract.files.fileInfo:id,key'])
->get()->toArray();
$contracts = [];
......@@ -135,9 +138,12 @@ class MusicianSongService extends Service
if (!empty($item['contract']['files'])) {
if ($file_info = array_column($item['contract']['files'], 'file_info')){
$files = array_column($file_info, 'location');
array_walk($files, function (&$location) { $location = env('resource_url'). $location; });
$files = array_column($file_info, 'key');
}
}
foreach ($files as &$file) {
$file = $client->getPreviewUrl($file);
}
$right = $role = [];
......