rabin 2 years ago
parent
commit
e3a6e2bf7d
5 changed files with 33 additions and 13 deletions
  1. 1 1
      database/opt.php
  2. 10 10
      src/Auth.php
  3. 17 1
      src/Database.php
  4. 1 1
      src/Doc.php
  5. 4 0
      src/Opt.php

+ 1 - 1
database/opt.php

@@ -223,7 +223,7 @@ return array
 			(
 				'col' => 'yes',
 				'time' => 'yes',
-				'num' => array('1', '+='),
+				'num' => array('yes', '+='),
 			),
 		),
 	),

+ 10 - 10
src/Auth.php

@@ -190,6 +190,16 @@ class Auth
         if (!$info) {
             return;
         }
+
+        if (!$info) {
+            $info = $this->auth();
+            if ($info) {
+                $this->save($info);
+                Dever::location(Dever::url(''));
+            }
+        }
+        $info = $this->role($info);
+
         $state = true;
         Dever::config('base')->getAdmin = 1;
         if ($state == true && Dever::config('base')->getAdmin && $info && isset($info['id'])) {
@@ -213,16 +223,6 @@ class Auth
             $info['username'] = $admin['username'];
         }
 
-
-        if (!$info) {
-            $info = $this->auth();
-            if ($info) {
-                $this->save($info);
-                Dever::location(Dever::url(''));
-            }
-        }
-        $info = $this->role($info);
-
         if (isset($info['role']) && $info['role']) {
             $info['role_info'] = Dever::db('manage/role')->one($info['role']);
             $info['rolename'] = '未分组';

+ 17 - 1
src/Database.php

@@ -4592,10 +4592,26 @@ class Database
                     }
 
                 } elseif (is_numeric($log[$j['name']]) && (strpos($i, 'time') !== false || strpos($i, 'date') !== false)) {
-                    $log[$j['name']] = date("Y-m-d H:i:s", $log[$j['name']]);
+                    if (!strstr($log[$j['name']], '-')) {
+                        $log[$j['name']] = date("Y-m-d H:i:s", $log[$j['name']]);
+                    }
                     if (isset($old[$i]) && $old[$i]) {
                         $old[$i] = date("Y-m-d H:i:s", $old[$i]);
                     }
+                } elseif (is_numeric($log[$j['name']]) && (strpos($i, 'day') !== false)) {
+                    if (!strstr($log[$j['name']], '-')) {
+                        $log[$j['name']] = date("Y-m-d", $log[$j['name']]);
+                    }
+                    if (isset($old[$i]) && $old[$i]) {
+                        $old[$i] = date("Y-m-d", $old[$i]);
+                    }
+                } elseif (is_numeric($log[$j['name']]) && (strpos($i, 'month') !== false)) {
+                    if (!strstr($log[$j['name']], '-')) {
+                        $log[$j['name']] = date("Y-m", $log[$j['name']]);
+                    }
+                    if (isset($old[$i]) && $old[$i]) {
+                        $old[$i] = date("Y-m", $old[$i]);
+                    }
                 } elseif (isset($j['decode'])) {
                     $log[$j['name']] = Dever::array_decode($log[$j['name']]);
 

+ 1 - 1
src/Doc.php

@@ -269,7 +269,7 @@ AUTO_INCREMENT=1
             }
         }
 
-        $this->create_nav($list, -50);
+        $this->create_nav($list, -1000);
 
         if (isset($this->data['nav'][$this->db]) && isset($data[$this->db])) {
             $this->doc = '介绍' . $this->data['nav'][$this->db]['name'] . '项目下的对外接口';

+ 4 - 0
src/Opt.php

@@ -131,6 +131,9 @@ class Opt
 	
 	private function update($project, $table, $col, $method = false, $time = 0)
 	{
+		if ($project == 'manage') {
+			return;
+		}
 		$param['option_project'] = $project;
 		$param['option_table'] = $table;
 		if ($method) $param['option_method'] = $method;
@@ -155,6 +158,7 @@ class Opt
 
 				$param['set_col'] = implode(',', $param['set_col']);
 				$param['set_time'] = $time;
+				$param['set_num'] = 1;
 				Dever::db('manage/opt')->updateNum($param);
 				$id = $info['id'];
 			} else {