dever il y a 6 ans
Parent
commit
5bab062e47
1 fichiers modifiés avec 10 ajouts et 1 suppressions
  1. 10 1
      src/View.php

+ 10 - 1
src/View.php

@@ -51,6 +51,10 @@ class View
             $data['file'] = Dever::db('upload/file')->getData($param);
             $data['cate'] = Dever::db('upload/cate')->state();
             $data['config'] = Dever::db('upload/upload')->one($key);
+
+            if ($data['config'] && isset($data['config']['yun']) && $data['config']['yun']) {
+                $data['yun'] = Dever::db('upload/yun')->one($data['config']['yun']);
+            }
         }
         
         $data['total'] = Dever::total();
@@ -59,7 +63,12 @@ class View
             $pic = Dever::config('host')->script . 'img/video.jpg';
             foreach ($data['file'] as $k => $v) {
                 if (!strstr($v['file'], 'http')) {
-                    $data['file'][$k]['url'] = Dever::upload('{uploadRes}' . $v['file']);
+                    if (isset($data['config']) && $data['config']['save_type'] >= 3 && isset($data['yun'])) {
+                        $data['file'][$k]['url'] = $data['yun']['host'] . $v['file'];
+                    } else {
+                        $data['file'][$k]['url'] = Dever::upload('{uploadRes}' . $v['file']);
+                    }
+                    
                 } else {
                     $data['file'][$k]['url'] = $v['file'];
                 }