Commit cc8f7fa4 cc8f7fa4cbe58fb067f9ca8f394cf44b008c8394 by lemon

文件地址

1 parent b6abffbb
...@@ -13,7 +13,9 @@ use App\Models\Legal\Treaty; ...@@ -13,7 +13,9 @@ use App\Models\Legal\Treaty;
13 */ 13 */
14 class MusicianAgreementService extends Service 14 class MusicianAgreementService extends Service
15 { 15 {
16 16 /**
17 * @return \Illuminate\Http\JsonResponse
18 */
17 public function treatyList() 19 public function treatyList()
18 { 20 {
19 $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']) 21 $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 ...@@ -24,7 +26,7 @@ class MusicianAgreementService extends Service
24 $files = []; 26 $files = [];
25 if (!empty($item_res['file'])) { 27 if (!empty($item_res['file'])) {
26 foreach ($item_res['file'] as $file_item) { 28 foreach ($item_res['file'] as $file_item) {
27 !empty($file_item['file_info']['location']) && $files[] = env('resource_url') . $file_item['file_info']['location']; 29 !empty($file_item['file_info']['location']) && $files[] = $file_item['file_info']['location'];
28 } 30 }
29 } 31 }
30 $item->setAttribute('files', $files); 32 $item->setAttribute('files', $files);
...@@ -51,7 +53,6 @@ class MusicianAgreementService extends Service ...@@ -51,7 +53,6 @@ class MusicianAgreementService extends Service
51 if (!empty($treaty_item['file'])) { 53 if (!empty($treaty_item['file'])) {
52 if ($file_info = array_column($treaty_item['file'], 'file_info')){ 54 if ($file_info = array_column($treaty_item['file'], 'file_info')){
53 $files = array_column($file_info, 'location'); 55 $files = array_column($file_info, 'location');
54 array_walk($files, function (&$location) { $location = env('resource_url'). $location; });
55 } 56 }
56 } 57 }
57 58
...@@ -80,7 +81,6 @@ class MusicianAgreementService extends Service ...@@ -80,7 +81,6 @@ class MusicianAgreementService extends Service
80 if (!empty($contract_item['files'])) { 81 if (!empty($contract_item['files'])) {
81 if ($file_info = array_column($contract_item['files'], 'file_info')){ 82 if ($file_info = array_column($contract_item['files'], 'file_info')){
82 $files = array_column($file_info, 'location'); 83 $files = array_column($file_info, 'location');
83 array_walk($files, function (&$location) { $location = env('resource_url'). $location; });
84 } 84 }
85 } 85 }
86 86
......