log.php 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. <?php
  2. /*
  3. |--------------------------------------------------------------------------
  4. | log.php 日志表
  5. |--------------------------------------------------------------------------
  6. */
  7. $admin = function()
  8. {
  9. $array = array();
  10. $info = Dever::load('manage/admin-state');
  11. if($info)
  12. {
  13. $array += $info;
  14. }
  15. return $array;
  16. };
  17. return array
  18. (
  19. # 表名
  20. 'name' => 'log',
  21. # 显示给用户看的名称
  22. 'lang' => '管理操作日志',
  23. # 关闭验证重复提交功能
  24. 'submit' => false,
  25. # 建表时进行分区,一般按照时间分区,仅在mysql类型有效
  26. 'partition' => array
  27. (
  28. 'type' => 'range',//range分区,具体的值请查看mysql分区类型
  29. 'col' => 'YEAR(cdate)',//分区的字段值
  30. 'value' => array(2000,2010),//分区的值
  31. 'exp' => 'LESS THEN',//LESS THEN还是in等表达式
  32. ),
  33. # 表类型 值为\innodb\myisam\,默认为innodb,仅在mysql类型有效
  34. //'type' => 'innodb',
  35. # 数据结构
  36. 'struct' => array
  37. (
  38. 'id' => array
  39. (
  40. 'type' => 'int-11',
  41. 'name' => 'ID',
  42. 'default' => '',
  43. 'desc' => '',
  44. 'match' => 'is_numeric',
  45. ),
  46. 'project' => array
  47. (
  48. 'type' => 'varchar-32',
  49. 'name' => '项目名',
  50. 'default' => '',
  51. 'desc' => '请输入项目名',
  52. 'match' => 'is_string',
  53. 'list' => 'Dever::load("manage/project.name", "{project}")',
  54. ),
  55. 'table' => array
  56. (
  57. 'type' => 'varchar-32',
  58. 'name' => '项目下的表名',
  59. 'default' => '',
  60. 'desc' => '项目下的表名',
  61. 'match' => 'is_string',
  62. 'list' => 'Dever::load("manage/database.getTableName", "{project}", "{table}")',
  63. ),
  64. 'info' => array
  65. (
  66. 'type' => 'longtext',
  67. 'name' => '日志记录',
  68. 'default' => '',
  69. 'desc' => '日志记录',
  70. 'match' => 'is_string',
  71. 'list' => 'base64_decode("{info}")',
  72. 'modal' => '查看详情',
  73. ),
  74. 'admin' => array
  75. (
  76. 'type' => 'int-11',
  77. 'name' => '操作人',
  78. 'default' => '',
  79. 'desc' => '操作人',
  80. 'match' => 'is_string',
  81. 'list' => 'Dever::load("manage/admin-one#username", {admin})',
  82. //'option' => $admin,
  83. 'search' => 'fulltext',
  84. ),
  85. 'tid' => array
  86. (
  87. 'type' => 'int-11',
  88. 'name' => '来源表id',
  89. 'default' => '',
  90. 'desc' => '来源表id',
  91. 'match' => 'is_string',
  92. ),
  93. 'state' => array
  94. (
  95. 'type' => 'tinyint-1',
  96. 'name' => '状态',
  97. 'default' => '1',
  98. 'desc' => '请选择状态',
  99. 'match' => 'option',
  100. ),
  101. 'cdate' => array
  102. (
  103. 'type' => 'int-11',
  104. 'name' => '操作时间',
  105. 'match' => array('is_numeric', time()),
  106. 'desc' => '',
  107. # 只有insert时才生效
  108. 'insert' => true,
  109. 'search' => 'time',
  110. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  111. ),
  112. ),
  113. 'manage' => array
  114. (
  115. 'delete' => false,
  116. ),
  117. # 索引
  118. 'index' => array
  119. (
  120. # 索引名 => 索引id
  121. //'id' => 'id,state',
  122. ),
  123. # request 请求接口定义
  124. 'request' => array
  125. (
  126. # onload 增加hack功能 使用该请求接口必须首先载入的类 如果需要子项也添加类似功能,可以使用start、end
  127. 'onload' => 'manage/auth.init',//这个是权限验证,必须后台登录
  128. ),
  129. );