作者 刘锟

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

... ... @@ -421,17 +421,19 @@ if (!function_exists('getImageUrl')) {
* @time :2023/7/20 16:46
*/
function getImageUrl($path,$location = 1){
if(empty($path)){
return '';
}
if((strpos($path,'https://')!== false) || (strpos($path,'http://') !== false)){
return $path;
}
if(is_array($path)){
$url =[];
foreach ($path as $v){
$url[] = getImageUrl($v);
}
$url = array_filter($url);
}else{
if(empty($path)){
return '';
}
if((strpos($path,'https://')!== false) || (strpos($path,'http://') !== false)){
return $path;
}
if($location == 1){
$cos = config('filesystems.disks.cos');
$cosCdn = $cos['cdn'];
... ...
... ... @@ -92,9 +92,9 @@ class CollectLogic extends Logic
'title' => $item['title'],
'url' => $this->domain . $item['route'],
'keywords' => $keyword,
'description' => strip_tags($item['intro']?:''),
'desc' => strip_tags($item['intro']?:''),
'content' => strip_tags($item['content'] ?: ''),
'img' => array_column($item['gallery'] ?: [], 'url')
'images' => getImageUrl(array_column($item['gallery'] ?: [], 'url'))
];
}
$list['list'] = $data;
... ... @@ -114,9 +114,9 @@ class CollectLogic extends Logic
'title' => $item['name'],
'url' => $this->domain . $item['url'],
'keywords' => $item['seo_keywords'],
'description' => strip_tags($item['remark']?:''),
'desc' => strip_tags($item['remark']?:''),
'content' => strip_tags($item['text'] ?: ''),
'img' => $item['image'] ?:''
'images' => getImageUrl([$item['image']] ?:[])
];
}
$list['list'] = $data;
... ... @@ -136,9 +136,9 @@ class CollectLogic extends Logic
'title' => $item['name'],
'url' => $this->domain . $item['url'],
'keywords' => $item['seo_keywords'],
'description' => strip_tags($item['remark']?:''),
'desc' => strip_tags($item['remark']?:''),
'content' => strip_tags($item['text'] ?: ''),
'img' => $item['image'] ?:''
'images' => getImageUrl([$item['image']] ?:[])
];
}
$list['list'] = $data;
... ...