dever 6 år sedan
förälder
incheckning
c0a401ad1e
2 ändrade filer med 15 tillägg och 1 borttagningar
  1. 14 1
      src/Manage.php
  2. 1 0
      src/Store/Local.php

+ 14 - 1
src/Manage.php

@@ -51,18 +51,31 @@ class Manage
         $table = array();
 
         $html = '';
+        $location = '';
         $config = Dever::db('upload/upload')->one($info['upload']);
-        if ($config['yun'] && $config['save_type'] > 1) {
+        if ($config['yun'] && $config['save_type'] > 2) {
             $yun = Dever::db('upload/yun')->one($config['yun']);
             $link = $yun['host'] . $info['file'];
+            $location = $yun['name'] . ':' . $info['file'];
+            if ($config['save_type'] == 3) {
+                $location = '<br/>' . '本地服务器:' . $info['file'];
+            }
         } else {
             $link = Dever::upload('{uploadRes}' . $info['file']);
+            $location = '本地服务器:' . $info['file'];
+
+            if ($config['save_type'] == 2) {
+                $yun = Dever::db('upload/yun')->one($config['yun']);
+                $link = $yun['host'] . $info['file'];
+                $location = '<br />' . $yun['name'] . ':' . $info['file'];
+            }
         }
         
         if (strstr($info['file'], '.png') || strstr($info['file'], '.jpg') || strstr($info['file'], '.gif')) {
             $html = '<img src="'.$link.'" width="100" />';
         }
 
+        $table['存储位置'] = $location;
         $table['文件名'] = $info['name'];
         $html .= Dever::table($table);
         return $html;

+ 1 - 0
src/Store/Local.php

@@ -61,6 +61,7 @@ class Local extends Core implements Config
 
 	public function getName()
     {
+    	print_r($this->data['file']['name']);die;
         $this->path()->name($this->data['file']['name'])->ext()->file();
         return $this->file;
     }