Commit cc8f7fa4 cc8f7fa4cbe58fb067f9ca8f394cf44b008c8394 by lemon

文件地址

1 parent b6abffbb
......@@ -13,7 +13,9 @@ use App\Models\Legal\Treaty;
*/
class MusicianAgreementService extends Service
{
/**
* @return \Illuminate\Http\JsonResponse
*/
public function treatyList()
{
$res = Treaty::query()->whereIn('party_b', $this->stakeholder_ids)->where('deadline_date', '>', $this->now)->with(['file:id,treaty_id,file_id', 'file.fileInfo:id,location'])
......@@ -24,7 +26,7 @@ class MusicianAgreementService extends Service
$files = [];
if (!empty($item_res['file'])) {
foreach ($item_res['file'] as $file_item) {
!empty($file_item['file_info']['location']) && $files[] = env('resource_url') . $file_item['file_info']['location'];
!empty($file_item['file_info']['location']) && $files[] = $file_item['file_info']['location'];
}
}
$item->setAttribute('files', $files);
......@@ -51,7 +53,6 @@ class MusicianAgreementService extends Service
if (!empty($treaty_item['file'])) {
if ($file_info = array_column($treaty_item['file'], 'file_info')){
$files = array_column($file_info, 'location');
array_walk($files, function (&$location) { $location = env('resource_url'). $location; });
}
}
......@@ -80,7 +81,6 @@ class MusicianAgreementService extends Service
if (!empty($contract_item['files'])) {
if ($file_info = array_column($contract_item['files'], 'file_info')){
$files = array_column($file_info, 'location');
array_walk($files, function (&$location) { $location = env('resource_url'). $location; });
}
}
......