ソースを参照

no commit message

齐博 1 年間 前
コミット
f8a0135ca0

+ 21 - 1
application/admin/controller/Setting.php

@@ -463,7 +463,7 @@ class Setting extends AdminBase
         
         //某分类下的所有参数选项
         $list_data = empty($group) ? [] : $this->model->getListByGroup($group,'c_key');
-        
+        $list_data = $this->limit_field($list_data);
         
         //联动字段
         $this->tab_ext['trigger'] = $this->getTrigger($list_data);
@@ -487,6 +487,26 @@ class Setting extends AdminBase
 		return $this->editContent($data);
     }
     
+    /**
+     * 隐藏的字段就不显示了
+     * @param array $array
+     * @return unknown
+     */
+    protected function limit_field($array=[]){
+        $ck = false;
+        foreach($array AS $key=>$rs){
+            if (!isset($rs['is_hide']) && !$ck && !table_field('config','is_hide')) {
+                $ck = true;
+                into_sql("ALTER TABLE `qb_config` ADD `is_hide` TINYINT( 1 ) NOT NULL COMMENT '是否隐藏,1是隐藏';
+ALTER TABLE  `qb_config` ADD INDEX (  `is_hide` ) COMMENT  '';");
+            }
+            if($rs['is_hide']){
+                unset($array[$key]);
+            }
+        }
+        return $array;
+    }
+    
     
     /**
      * 获得某些字段要关联其它字段

+ 2 - 0
application/install/sql/install.sql

@@ -1514,3 +1514,5 @@ ALTER TABLE `qb_memberdata` ADD `qq_open_api` VARCHAR( 32 ) NOT NULL COMMENT '
 INSERT INTO `qb_config` (`id`, `type`, `title`, `c_key`, `c_value`, `form_type`, `options`, `ifsys`, `htmlcode`, `c_descrip`, `list`, `sys_id`) VALUES(0, 20, 'APP专属QQ登录appid', 'qqopen_appid', '', 'text', '', 1, '', '前期申请的与网页QQ登录相同,就留空(后期申请的,都不相同)', 0, -9);
 INSERT INTO `qb_config` (`id`, `type`, `title`, `c_key`, `c_value`, `form_type`, `options`, `ifsys`, `htmlcode`, `c_descrip`, `list`, `sys_id`) VALUES(0, 20, 'APP专属QQ登录接口密钥', 'qqopen_appsecret', '', 'text', '', 1, '', '前期申请的与网页QQ登录相同,就留空(后期申请的,都不相同)', 0, -9);
 
+ALTER TABLE `qb_config` ADD `is_hide` TINYINT( 1 ) NOT NULL COMMENT '是否隐藏,1是隐藏';
+ALTER TABLE  `qb_config` ADD INDEX (  `is_hide` ) COMMENT  '';

+ 2 - 0
plugins/config_set/admin/Config.php

@@ -50,6 +50,7 @@ class Config extends AdminBase
 	            ['text', 'c_descrip', '介绍描述'],
 	            ['radio', 'ifsys', '是否属于系统全局参数字段','变量值全站通用,不局限于某个插件模块',['否','是'],intval($info['ifsys'])],
 	        ['radio', 'is_open', '是否裸露给外部接口','密钥等重要参数就不能裸露给外部接口调用',['否','是'],intval($info['ifsys'])],
+	        ['radio', 'is_hide', '是否禁用','选择禁用的话,将不在系统参数那里显示,但不影响原来已设置的值',['否','是'],intval($info['is_hide'])],
 	            //['textarea', 'htmlcode', '额外HTML代码'],
 	    ];
 	    
@@ -240,6 +241,7 @@ class Config extends AdminBase
 
 		$this->list_items = [
 				['c_key', '关键字变量名', 'text'],  
+		    ['is_hide', '禁用', 'switch'],
 		    ['is_open', '裸露', 'yesno'],
 				['title', '名称', 'text.edit'],
 				['form_type', '表单类型', 'select2',config('form')],