Prechádzať zdrojové kódy

修复默认皮肤

改进内置服务器
优化伪静态
Karson 3 rokov pred
rodič
commit
d1cdc51798

+ 1 - 1
application/admin/command/Install/fastadmin.sql

@@ -63,7 +63,7 @@ CREATE TABLE `fa_area` (
   `shortname` varchar(100) DEFAULT NULL COMMENT '简称',
   `name` varchar(100) DEFAULT NULL COMMENT '名称',
   `mergename` varchar(255) DEFAULT NULL COMMENT '全称',
-  `level` tinyint(4) DEFAULT NULL COMMENT '层级 0 1 2 省市区县',
+  `level` tinyint(4) DEFAULT NULL COMMENT '层级:1=省,2=市,3=区/县',
   `pinyin` varchar(100) DEFAULT NULL COMMENT '拼音',
   `code` varchar(100) DEFAULT NULL COMMENT '长途区号',
   `zip` varchar(100) DEFAULT NULL COMMENT '邮编',

+ 6 - 5
application/admin/model/User.php

@@ -48,10 +48,10 @@ class User extends Model
         self::beforeUpdate(function ($row) {
             $changedata = $row->getChangedData();
             $origin = $row->getOriginData();
-            if (isset($changedata['money']) && (function_exists('bccomp') ? bccomp($changedata['money'], $origin['money'], 2) !== 0 : (double) $changedata['money'] !== (double) $origin['money'])) {
+            if (isset($changedata['money']) && (function_exists('bccomp') ? bccomp($changedata['money'], $origin['money'], 2) !== 0 : (double)$changedata['money'] !== (double)$origin['money'])) {
                 MoneyLog::create(['user_id' => $row['id'], 'money' => $changedata['money'] - $origin['money'], 'before' => $origin['money'], 'after' => $changedata['money'], 'memo' => '管理员变更金额']);
             }
-            if (isset($changedata['score']) && (int) $changedata['score'] !== (int) $origin['score']) {
+            if (isset($changedata['score']) && (int)$changedata['score'] !== (int)$origin['score']) {
                 ScoreLog::create(['user_id' => $row['id'], 'score' => $changedata['score'] - $origin['score'], 'before' => $origin['score'], 'after' => $changedata['score'], 'memo' => '管理员变更积分']);
             }
         });
@@ -67,21 +67,22 @@ class User extends Model
         return ['normal' => __('Normal'), 'hidden' => __('Hidden')];
     }
 
+
     public function getPrevtimeTextAttr($value, $data)
     {
-        $value = $value ? $value : $data['prevtime'];
+        $value = $value ? $value : ($data['prevtime'] ?? "");
         return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
     }
 
     public function getLogintimeTextAttr($value, $data)
     {
-        $value = $value ? $value : $data['logintime'];
+        $value = $value ? $value : ($data['logintime'] ?? "");
         return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
     }
 
     public function getJointimeTextAttr($value, $data)
     {
-        $value = $value ? $value : $data['jointime'];
+        $value = $value ? $value : ($data['jointime'] ?? "");
         return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
     }
 

+ 1 - 1
application/admin/view/index/index.html

@@ -4,7 +4,7 @@
         <!-- 加载样式及META信息 -->
         {include file="common/meta" /}
     </head>
-    <body class="hold-transition {$Think.config.fastadmin.adminskin|default='skin-black-green'} sidebar-mini {:$Think.cookie.sidebar_collapse?'sidebar-collapse':''} fixed {:$Think.config.fastadmin.multipletab?'multipletab':''} {:$Think.config.fastadmin.multiplenav?'multiplenav':''}" id="tabs">
+    <body class="hold-transition {$Think.config.fastadmin.adminskin|default='skin-black-blue'} sidebar-mini {:$Think.cookie.sidebar_collapse?'sidebar-collapse':''} fixed {:$Think.config.fastadmin.multipletab?'multipletab':''} {:$Think.config.fastadmin.multiplenav?'multiplenav':''}" id="tabs">
 
         <div class="wrapper">
 

+ 1 - 1
public/.htaccess

@@ -4,5 +4,5 @@
 
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteCond %{REQUEST_FILENAME} !-f
-  RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1]
+  RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
 </IfModule>

+ 3 - 1
public/router.php

@@ -10,8 +10,10 @@
 // +----------------------------------------------------------------------
 // $Id$
 
-if (is_file($_SERVER["DOCUMENT_ROOT"] . $_SERVER["REQUEST_URI"])) {
+if (is_file($_SERVER["DOCUMENT_ROOT"] . $_SERVER["SCRIPT_NAME"])) {
     return false;
 } else {
+    $_SERVER["SCRIPT_FILENAME"] = __DIR__ . '/index.php';
+
     require __DIR__ . "/index.php";
 }