rabin 6 năm trước cách đây
mục cha
commit
140c3ebaa5
1 tập tin đã thay đổi với 26 bổ sung6 xóa
  1. 26 6
      src/View.php

+ 26 - 6
src/View.php

@@ -17,18 +17,38 @@ class View
         $key = Dever::input('key');
         $param['upload'] = $key;
         $file = Dever::db('upload/file')->state();
-        print_r($file);die;
+        $list = array();
+        if ($file) {
+
+            $i = 0;
+            foreach ($file as $k => $v) {
+                if ($v['name'] && $v['file']) {
+                    $list[$i] = array();
+                    $list[$i]['is_dir'] = false;
+                    $list[$i]['has_file'] = false;
+                    $list[$i]['filesize'] = $v['size'];
+                    $list[$i]['dir_path'] = '';
+                    $list[$i]['is_photo'] = true;
+                    $list[$i]['filetype'] = str_replace('.', '', $v['ext']);
+                    $list[$i]['filename'] = $v['source_name'];
+                    $list[$i]['file'] = Dever::upload('{uploadRes}' . $v['file']);
+                    $list[$i]['datetime'] = date('Y-m-d H:i:s', filemtime(Dever::local($list[$i]['file'])));
+                    $i++;
+                }
+            }
+        }
+
         $result = array();
         //相对于根目录的上一级目录
-        $result['moveup_dir_path'] = $moveup_dir_path;
+        $result['moveup_dir_path'] = '';
         //相对于根目录的当前目录
-        $result['current_dir_path'] = $current_dir_path;
+        $result['current_dir_path'] = '';
         //当前目录的URL
-        $result['current_url'] = $current_url;
+        $result['current_url'] = '';
         //文件数
-        $result['total_count'] = count($file_list);
+        $result['total_count'] = count($list);
         //文件列表数组
-        $result['file_list'] = $file_list;
+        $result['file_list'] = $list;
 
         Dever::outDiy($result);
     }