Browse Source

图片处理改进

lizhen_gitee 1 year ago
parent
commit
8045ae223c
1 changed files with 4 additions and 3 deletions
  1. 4 3
      application/common.php

+ 4 - 3
application/common.php

@@ -543,18 +543,19 @@ function info_domain_image($data,$field){
     }
     foreach($data as $key => $val){
         if(in_array($key,$field)){
-            $data[$key] = one_domain_image($val);
+            $more = strpos($key,'images');
+            $data[$key] = one_domain_image($val,$more);
         }
     }
     return $data;
 }
 //支持单个字段,需要增加domain_cdnurl
 //支持image,images
-function one_domain_image($one){
+function one_domain_image($one,$more = false){
     if(!$one){
         return $one;
     }
-    if(strpos($one,',')){
+    if(strpos($one,',') || $more !== false){
         //逗号隔开的多个图片
         $one = explode(',',$one);
         foreach($one as $k => $v){