作者 刘锟

update

... ... @@ -622,13 +622,28 @@ class ProjectUpdate extends Command
if ($extend) {
$extend_info = $extend_info_model->read(['key' => $extend['key'], 'content_id' => $id]);
if (!$extend_info) {
if ($extend['type'] == 3) {
$gallery = [];
if (is_array($ve)) {
foreach ($ve as $ve_img) {
$gallery[] = ['title' => '', 'description' => '', 'url' => $this->source_download($ve_img, $project_id, $domain_arr['host'], $web_url_domain, $home_url)];
}
}else{
$gallery[] = ['title' => '', 'description' => '', 'url' => $this->source_download($ve, $project_id, $domain_arr['host'], $web_url_domain, $home_url)];
}
$value = Arr::a2s($gallery);
} elseif ($extend['type'] == 4) {
$value = Arr::a2s([$this->source_download($ve, $project_id, $domain_arr['host'], $web_url_domain, $home_url)]);
} else {
$value = $ve;
}
$extend_info_model->add([
'key' => $extend['key'],
'type' => $extend['type'],
'project_id' => $project_id,
'content_id' => $id,
'module_id' => $custom_info['id'],
'values' => $ve,
'values' => $value,
]);
}
}
... ...
... ... @@ -492,14 +492,21 @@ if (!function_exists('getFileUrl')) {
* @time :2023/7/20 16:46
*/
function getFileUrl($path,$location = 1){
if(empty($path)){
return '';
}
if(is_array($path)){
$url =[];
foreach ($path as $v){
$url[] = getFileUrl($v);
}
}else{
if(empty($path)){
return '';
}
if((strpos($path,'https://')!== false) || (strpos($path,'http://') !== false)){
return $path;
}
if(substr($path,0,2) == '//'){
return 'https:'.$path;
}
if($location == 1){
$cos = config('filesystems.disks.cos');
$cosCdn = $cos['cdn'];
... ...