rabin 3 年之前
父节点
当前提交
c9f1a0a11a
共有 2 个文件被更改,包括 20 次插入19 次删除
  1. 1 0
      database/admin.php
  2. 19 19
      src/Database.php

+ 1 - 0
database/admin.php

@@ -682,6 +682,7 @@ return array
 			'match' 	=> array('is_numeric', DEVER_TIME),
 			'desc' 		=> '',
 			# 只有insert时才生效
+			//'search'    => 'month_eq',//month 是月份区间搜索,year是年份区间搜索,eq是相等月份搜索
 			'insert'	=> true,
 			'list'		=> 'date("Y-m-d H:i:s", {cdate})',
 		),

+ 19 - 19
src/Database.php

@@ -750,31 +750,31 @@ class Database
             if (isset($config['manage']['list_type'])) {
                 $config['manage']['list_table'] = 'html';
             }
-        }
 
-        $config['state'] = $this->getState();
-        $config['project'] = $project;
-
-        # 新增排序
-        $l = isset($_GET['l']) ? $_GET['l'] : '';
-        if ($l == 'project/database/list' || $l == 'database.list_excel') {
-            $list_order = array();
-            $i = 0;
-            foreach ($config['struct'] as $ki => $vi) {
-                if (isset($vi['list_order'])) {
-                    $list_order[] = $vi['list_order'];
-                } else {
-                    $config['struct'][$ki]['list_order'] = $i;
-                    $list_order[] = $i;
+            # 新增排序
+            $l = isset($_GET['l']) ? $_GET['l'] : '';
+            if ($l == 'project/database/list' || $l == 'database.list_excel') {
+                $list_order = array();
+                $i = 0;
+                foreach ($config['struct'] as $ki => $vi) {
+                    if (isset($vi['list_order'])) {
+                        $list_order[] = $vi['list_order'];
+                    } else {
+                        $config['struct'][$ki]['list_order'] = $i;
+                        $list_order[] = $i;
+                    }
+                    $i++;
                 }
-                $i++;
-            }
 
-            if ($list_order) {
-                array_multisort($list_order, SORT_ASC, SORT_NUMERIC, $config['struct']);
+                if ($list_order) {
+                    array_multisort($list_order, SORT_ASC, SORT_NUMERIC, $config['struct']);
+                }
             }
         }
 
+        $config['state'] = $this->getState();
+        $config['project'] = $project;
+
         return $config;
     }