Your Name 2 anos atrás
pai
commit
ab20b64258
2 arquivos alterados com 21 adições e 1 exclusões
  1. 4 0
      service/agent/lib/Core.php
  2. 17 1
      service/setting/database/base.php

+ 4 - 0
service/agent/lib/Core.php

@@ -13,6 +13,10 @@ class Core
 
     public function __construct()
     {
+        $config = Dever::db('setting/base')->one();
+        if($config['type'] == 2){
+            Dever::alert('系统正在维护中', -4);
+        }
         $this->uid = Dever::load('passport/user')->check(false);
         if ($this->uid <= 0) {
             //$this->uid = 4133;

+ 17 - 1
service/setting/database/base.php

@@ -5,7 +5,11 @@ $home_top_type = array
 	1 => '显示',
 	2 => '不显示',
 );
-
+$type = array
+(
+    1 => '开放中',
+    2 => '维护中',
+);
 return array
 (
 	# 表名
@@ -117,6 +121,18 @@ return array
 			'match' 	=> 'is_string',
 			'update'	=> 'text',
 		),
+
+		'type'        => array
+        (
+            'type'      => 'tinyint-1',
+            'name'      => '系统是否开放',
+            'default'   => '1',
+            'desc'      => '类型',
+            'match'     => 'is_numeric',
+            'option'    => $type,
+            'update'    => 'radio',
+            'control'   => 'type',
+        ),
 		// 'market_desc'      => array
   //       (
   //           'type'      => 'text-255',