作者 刘锟

update

@@ -622,13 +622,28 @@ class ProjectUpdate extends Command @@ -622,13 +622,28 @@ class ProjectUpdate extends Command
622 if ($extend) { 622 if ($extend) {
623 $extend_info = $extend_info_model->read(['key' => $extend['key'], 'content_id' => $id]); 623 $extend_info = $extend_info_model->read(['key' => $extend['key'], 'content_id' => $id]);
624 if (!$extend_info) { 624 if (!$extend_info) {
  625 + if ($extend['type'] == 3) {
  626 + $gallery = [];
  627 + if (is_array($ve)) {
  628 + foreach ($ve as $ve_img) {
  629 + $gallery[] = ['title' => '', 'description' => '', 'url' => $this->source_download($ve_img, $project_id, $domain_arr['host'], $web_url_domain, $home_url)];
  630 + }
  631 + }else{
  632 + $gallery[] = ['title' => '', 'description' => '', 'url' => $this->source_download($ve, $project_id, $domain_arr['host'], $web_url_domain, $home_url)];
  633 + }
  634 + $value = Arr::a2s($gallery);
  635 + } elseif ($extend['type'] == 4) {
  636 + $value = Arr::a2s([$this->source_download($ve, $project_id, $domain_arr['host'], $web_url_domain, $home_url)]);
  637 + } else {
  638 + $value = $ve;
  639 + }
625 $extend_info_model->add([ 640 $extend_info_model->add([
626 'key' => $extend['key'], 641 'key' => $extend['key'],
627 'type' => $extend['type'], 642 'type' => $extend['type'],
628 'project_id' => $project_id, 643 'project_id' => $project_id,
629 'content_id' => $id, 644 'content_id' => $id,
630 'module_id' => $custom_info['id'], 645 'module_id' => $custom_info['id'],
631 - 'values' => $ve, 646 + 'values' => $value,
632 ]); 647 ]);
633 } 648 }
634 } 649 }
@@ -492,14 +492,21 @@ if (!function_exists('getFileUrl')) { @@ -492,14 +492,21 @@ if (!function_exists('getFileUrl')) {
492 * @time :2023/7/20 16:46 492 * @time :2023/7/20 16:46
493 */ 493 */
494 function getFileUrl($path,$location = 1){ 494 function getFileUrl($path,$location = 1){
495 - if(empty($path)){  
496 - return '';  
497 - }  
498 if(is_array($path)){ 495 if(is_array($path)){
  496 + $url =[];
499 foreach ($path as $v){ 497 foreach ($path as $v){
500 $url[] = getFileUrl($v); 498 $url[] = getFileUrl($v);
501 } 499 }
502 }else{ 500 }else{
  501 + if(empty($path)){
  502 + return '';
  503 + }
  504 + if((strpos($path,'https://')!== false) || (strpos($path,'http://') !== false)){
  505 + return $path;
  506 + }
  507 + if(substr($path,0,2) == '//'){
  508 + return 'https:'.$path;
  509 + }
503 if($location == 1){ 510 if($location == 1){
504 $cos = config('filesystems.disks.cos'); 511 $cos = config('filesystems.disks.cos');
505 $cosCdn = $cos['cdn']; 512 $cosCdn = $cos['cdn'];