作者 刘锟

Merge remote-tracking branch 'origin/master' into akun

@@ -421,17 +421,19 @@ if (!function_exists('getImageUrl')) { @@ -421,17 +421,19 @@ if (!function_exists('getImageUrl')) {
421 * @time :2023/7/20 16:46 421 * @time :2023/7/20 16:46
422 */ 422 */
423 function getImageUrl($path,$location = 1){ 423 function getImageUrl($path,$location = 1){
424 - if(empty($path)){  
425 - return '';  
426 - }  
427 - if((strpos($path,'https://')!== false) || (strpos($path,'http://') !== false)){  
428 - return $path;  
429 - }  
430 if(is_array($path)){ 424 if(is_array($path)){
  425 + $url =[];
431 foreach ($path as $v){ 426 foreach ($path as $v){
432 $url[] = getImageUrl($v); 427 $url[] = getImageUrl($v);
433 } 428 }
  429 + $url = array_filter($url);
434 }else{ 430 }else{
  431 + if(empty($path)){
  432 + return '';
  433 + }
  434 + if((strpos($path,'https://')!== false) || (strpos($path,'http://') !== false)){
  435 + return $path;
  436 + }
435 if($location == 1){ 437 if($location == 1){
436 $cos = config('filesystems.disks.cos'); 438 $cos = config('filesystems.disks.cos');
437 $cosCdn = $cos['cdn']; 439 $cosCdn = $cos['cdn'];
@@ -92,9 +92,9 @@ class CollectLogic extends Logic @@ -92,9 +92,9 @@ class CollectLogic extends Logic
92 'title' => $item['title'], 92 'title' => $item['title'],
93 'url' => $this->domain . $item['route'], 93 'url' => $this->domain . $item['route'],
94 'keywords' => $keyword, 94 'keywords' => $keyword,
95 - 'description' => strip_tags($item['intro']?:''), 95 + 'desc' => strip_tags($item['intro']?:''),
96 'content' => strip_tags($item['content'] ?: ''), 96 'content' => strip_tags($item['content'] ?: ''),
97 - 'img' => array_column($item['gallery'] ?: [], 'url') 97 + 'images' => getImageUrl(array_column($item['gallery'] ?: [], 'url'))
98 ]; 98 ];
99 } 99 }
100 $list['list'] = $data; 100 $list['list'] = $data;
@@ -114,9 +114,9 @@ class CollectLogic extends Logic @@ -114,9 +114,9 @@ class CollectLogic extends Logic
114 'title' => $item['name'], 114 'title' => $item['name'],
115 'url' => $this->domain . $item['url'], 115 'url' => $this->domain . $item['url'],
116 'keywords' => $item['seo_keywords'], 116 'keywords' => $item['seo_keywords'],
117 - 'description' => strip_tags($item['remark']?:''), 117 + 'desc' => strip_tags($item['remark']?:''),
118 'content' => strip_tags($item['text'] ?: ''), 118 'content' => strip_tags($item['text'] ?: ''),
119 - 'img' => $item['image'] ?:'' 119 + 'images' => getImageUrl([$item['image']] ?:[])
120 ]; 120 ];
121 } 121 }
122 $list['list'] = $data; 122 $list['list'] = $data;
@@ -136,9 +136,9 @@ class CollectLogic extends Logic @@ -136,9 +136,9 @@ class CollectLogic extends Logic
136 'title' => $item['name'], 136 'title' => $item['name'],
137 'url' => $this->domain . $item['url'], 137 'url' => $this->domain . $item['url'],
138 'keywords' => $item['seo_keywords'], 138 'keywords' => $item['seo_keywords'],
139 - 'description' => strip_tags($item['remark']?:''), 139 + 'desc' => strip_tags($item['remark']?:''),
140 'content' => strip_tags($item['text'] ?: ''), 140 'content' => strip_tags($item['text'] ?: ''),
141 - 'img' => $item['image'] ?:'' 141 + 'images' => getImageUrl([$item['image']] ?:[])
142 ]; 142 ];
143 } 143 }
144 $list['list'] = $data; 144 $list['list'] = $data;