소스 검색

Wesmiler 人人车 初始化项目 0816

APPLE 3 년 전
부모
커밋
0a36f0bb18
3개의 변경된 파일12개의 추가작업 그리고 2개의 파일을 삭제
  1. 4 0
      application/admin/controller/store/Store.php
  2. 7 1
      application/admin/controller/system/Annex.php
  3. 1 1
      application/common/model/Store.php

+ 4 - 0
application/admin/controller/store/Store.php

@@ -21,6 +21,10 @@ class Store extends AdminController
     public function index()
     {
         $where = [];
+        $type = $this->request->get('type', 0);
+        if($type>0){
+            $where['type'] = $type;
+        }
         //组合搜索
         $model = model('common/Store');
 

+ 7 - 1
application/admin/controller/system/Annex.php

@@ -39,12 +39,16 @@ class Annex extends AdminController
                 // 'create_at' => filectime(app()->getRootPath() . '/public/uploads/' . rawurlencode($dir))
             ];
         }
+
         // halt($dirs);
         // 取出本地存储文件
         foreach ($filesystem->getFiles() as $file) {
+            if($file == '..' || $file == '.DS_Store'){
+                continue;
+            }
 
             $type = get_file_ext($file);
-
+//            $file = isset($file['name'])? ltrim($file['name'],'/') : '';
             $info = [
                 'name' => $file,
                 'type' => $type,
@@ -52,11 +56,13 @@ class Annex extends AdminController
                 'url' => get_annex_url($path . '/' . $file),
                 'create_at' => filectime(app()->getRootPath() . "/public/uploads/" . $path . '/' . $file)
             ];
+
             if (in_array($type, ['png', 'jpg', 'jpeg', 'gif'])) {
                 $info['thumbs'] = get_annex_url($path . '/' . $file);
             }
             $annex[] = $info;
         }
+
         $total = count($annex);
         $array = [];
         // 分页处理

+ 1 - 1
application/common/model/Store.php

@@ -9,7 +9,7 @@ class Store extends BaseModel
     /**
      * @var string
      */
-    protected $name = 'store';
+    protected $name = 'stores';
     /**
      * @var array
      */