作者 lyh

Merge branch 'develop' of http://47.244.231.31:8099/zhl/globalso-v6

@@ -455,11 +455,11 @@ if (!function_exists('getImageUrl')) { @@ -455,11 +455,11 @@ if (!function_exists('getImageUrl')) {
455 * @method :post 455 * @method :post
456 * @time :2023/7/20 16:46 456 * @time :2023/7/20 16:46
457 */ 457 */
458 - function getImageUrl($path,$storage_type = 0){ 458 + function getImageUrl($path,$storage_type = 0,$location = 1){
459 if(is_array($path)){ 459 if(is_array($path)){
460 $url =[]; 460 $url =[];
461 foreach ($path as $v){ 461 foreach ($path as $v){
462 - $url[] = getImageUrl($v,$storage_type); 462 + $url[] = getImageUrl($v,$storage_type,$location);
463 } 463 }
464 }else{ 464 }else{
465 if(empty($path)){ 465 if(empty($path)){
@@ -471,12 +471,12 @@ if (!function_exists('getImageUrl')) { @@ -471,12 +471,12 @@ if (!function_exists('getImageUrl')) {
471 if(substr($path,0,2) == '//'){ 471 if(substr($path,0,2) == '//'){
472 return 'https:'.$path; 472 return 'https:'.$path;
473 } 473 }
474 - $imageModel = new Image();  
475 - $imageInfo = $imageModel->read(['path'=>$path],['is_cos']);  
476 - if($imageInfo === false){  
477 - return '';  
478 - }  
479 - if($imageInfo['is_cos'] == 1){ 474 +// $imageModel = new Image();
  475 +// $imageInfo = $imageModel->read(['path'=>$path],['is_cos']);
  476 +// if($imageInfo === false){
  477 +// return '';
  478 +// }
  479 + if($location == 1){
480 $cos = config('filesystems.disks.cos'); 480 $cos = config('filesystems.disks.cos');
481 $cosCdn = ($storage_type == 0) ? $cos['cdn'] : $cos['cdn1']; 481 $cosCdn = ($storage_type == 0) ? $cos['cdn'] : $cos['cdn1'];
482 $url = $cosCdn.$path; 482 $url = $cosCdn.$path;
@@ -498,11 +498,11 @@ if (!function_exists('getFileUrl')) { @@ -498,11 +498,11 @@ if (!function_exists('getFileUrl')) {
498 * @method :post 498 * @method :post
499 * @time :2023/7/20 16:46 499 * @time :2023/7/20 16:46
500 */ 500 */
501 - function getFileUrl($path,$storage_type = 0){ 501 + function getFileUrl($path,$storage_type = 0,$location = 1){
502 if(is_array($path)){ 502 if(is_array($path)){
503 $url =[]; 503 $url =[];
504 foreach ($path as $v){ 504 foreach ($path as $v){
505 - $url[] = getFileUrl($v,$storage_type); 505 + $url[] = getFileUrl($v,$storage_type,$location);
506 } 506 }
507 }else{ 507 }else{
508 if(empty($path)){ 508 if(empty($path)){
@@ -514,12 +514,12 @@ if (!function_exists('getFileUrl')) { @@ -514,12 +514,12 @@ if (!function_exists('getFileUrl')) {
514 if(substr($path,0,2) == '//'){ 514 if(substr($path,0,2) == '//'){
515 return 'https:'.$path; 515 return 'https:'.$path;
516 } 516 }
517 - $fileModel = new FileModel();  
518 - $fileInfo = $fileModel->read(['path'=>$path],['is_cos']);  
519 - if($fileInfo === false){  
520 - return '';  
521 - }  
522 - if($fileInfo['is_cos'] == 1){ 517 +// $fileModel = new FileModel();
  518 +// $fileInfo = $fileModel->read(['path'=>$path],['is_cos']);
  519 +// if($fileInfo === false){
  520 +// return '';
  521 +// }
  522 + if($location == 1){
523 $cos = config('filesystems.disks.cos'); 523 $cos = config('filesystems.disks.cos');
524 $cosCdn = ($storage_type == 0) ? $cos['cdn'] : $cos['cdn1']; 524 $cosCdn = ($storage_type == 0) ? $cos['cdn'] : $cos['cdn1'];
525 $url = $cosCdn.$path; 525 $url = $cosCdn.$path;