123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209 |
- <?php
- /*
- |--------------------------------------------------------------------------
- | log.php 日志表
- |--------------------------------------------------------------------------
- */
- $admin = function()
- {
- $array = array();
- $info = Dever::load('manage/admin-state');
- if($info)
- {
- $array += $info;
- }
- return $array;
- };
- $type = array
- (
- 1 => '新增',
- 2 => '更新',
- 3 => '删除',
- 4 => '恢复',
- );
- return array
- (
- # 表名
- 'name' => 'log',
- # 显示给用户看的名称
- 'lang' => '操作日志',
- # 关闭验证重复提交功能
- 'submit' => false,
- 'config_type' => $type,
- # 建表时进行分区,一般按照时间分区,仅在mysql类型有效
- 'partition' => array
- (
- 'type' => 'range',//range分区,具体的值请查看mysql分区类型
- 'col' => 'YEAR(cdate)',//分区的字段值
- 'value' => array(2000,2010),//分区的值
- 'exp' => 'LESS THEN',//LESS THEN还是in等表达式
- ),
- 'order' => 66,
- # 表类型 值为\innodb\myisam\,默认为innodb,仅在mysql类型有效
- //'type' => 'innodb',
- # 数据结构
- 'struct' => array
- (
- 'id' => array
- (
- 'type' => 'int-11',
- 'name' => 'ID',
- 'default' => '',
- 'desc' => '',
- 'match' => 'is_numeric',
- 'list' => true,
- ),
-
- 'project' => array
- (
- 'type' => 'varchar-80',
- 'name' => '项目名',
- 'default' => '',
- 'desc' => '请输入项目名',
- 'match' => 'is_string',
- //'list' => 'Dever::load("manage/project.name", "{project}")',
- ),
-
- 'table' => array
- (
- 'type' => 'varchar-80',
- 'name' => '项目下的表名',
- 'default' => '',
- 'desc' => '项目下的表名',
- 'match' => 'is_string',
- //'list' => 'Dever::load("manage/database.getTableName", "{project}", "{table}")',
- ),
- 'menu_id' => array
- (
- 'type' => 'varchar-80',
- 'name' => '菜单',
- 'default' => '',
- 'desc' => '菜单',
- 'match' => 'is_string',
- 'search' => 'linkage',
- 'update' => 'linkage',
- 'option' => Dever::url('menu.getManageMenu', 'manage'),
- //'list' => 'Dever::load("manage/menu-one#name", "{menu_id}")',
- 'list' => 'Dever::load("manage/src/lib/log.getMenuInfo", "{menu_id}")',
- ),
- 'name' => array
- (
- 'type' => 'varchar-80',
- 'name' => '操作名',
- 'default' => '',
- 'desc' => '操作名',
- 'match' => 'is_string',
- 'search' => 'fulltext',
- 'list' => true,
- ),
- 'type' => array
- (
- 'type' => 'tinyint-1',
- 'name' => '操作类型',
- 'default' => '1',
- 'desc' => '操作类型',
- 'match' => 'is_numeric',
- 'option' => $type,
- 'search' => 'select',
- 'update' => 'radio',
- 'list' => true,
- ),
-
- 'admin' => array
- (
- 'type' => 'int-11',
- 'name' => '操作人',
- 'default' => '',
- 'desc' => '操作人',
- 'match' => 'is_string',
- 'search' => array
- (
- 'api' => 'manage/admin-getSearch',
- 'col' => 'col',
- 'result' => 'id',
- 'search' => 'admin',
- ),
- 'list' => 'Dever::load("manage/admin-one#username", {admin})',
- //'option' => $admin,
- ),
- 'info' => array
- (
- 'type' => 'longtext',
- 'name' => '操作记录',
- 'default' => '',
- 'desc' => '操作记录',
- 'match' => 'is_string',
- 'search' => 'fulltext',
- 'list' => 'Dever::load("manage/src/lib/log.getInfo", "{id}")',
- //'modal' => '查看详情',
- ),
-
- 'tid' => array
- (
- 'type' => 'int-11',
- 'name' => '来源表id',
- 'default' => '',
- 'desc' => '来源表id',
- 'match' => 'is_string',
- //'list' => true,
- ),
- 'state' => array
- (
- 'type' => 'tinyint-1',
- 'name' => '状态',
- 'default' => '1',
- 'desc' => '请选择状态',
- 'match' => 'option',
- ),
-
- 'cdate' => array
- (
- 'type' => 'int-11',
- 'name' => '操作时间',
- 'match' => array('is_numeric', time()),
- 'desc' => '',
- # 只有insert时才生效
- 'insert' => true,
- 'search' => 'time',
- 'list' => 'date("Y-m-d H:i:s", {cdate})',
- ),
- ),
- 'manage' => array
- (
- 'list_table' => 'html',
- 'delete' => false,
- 'edit' => false,
- 'insert' => false,
- 'link' => 'parent=log',
- 'button' => array
- (
- '字段记录' => array('list', 'opt'),
- '计划任务' => array('list', 'cron'),
- '接口列表' => array('list', 'api'),
- ),
- ),
-
- # 索引
- 'index' => array
- (
- # 索引名 => 索引id
- //'id' => 'id,state',
- ),
-
- # request 请求接口定义
- 'request' => array
- (
- # onload 增加hack功能 使用该请求接口必须首先载入的类 如果需要子项也添加类似功能,可以使用start、end
- 'onload' => 'manage/auth.init',//这个是权限验证,必须后台登录
- ),
- );
|