record.php 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. <?php
  2. $type = array
  3. (
  4. 1 => '浏览',
  5. 2 => '更新',
  6. );
  7. $info = function()
  8. {
  9. $array = array();
  10. $info = Dever::load('set/info-state');
  11. if($info)
  12. {
  13. $array += $info;
  14. }
  15. return $array;
  16. };
  17. return array
  18. (
  19. # 表名
  20. 'name' => 'record',
  21. # 显示给用户看的名称
  22. 'lang' => '日志列表',
  23. # 是否显示在后台菜单
  24. 'order' => 80,
  25. # 数据结构
  26. 'struct' => array
  27. (
  28. 'id' => array
  29. (
  30. 'type' => 'int-11',
  31. 'name' => 'ID',
  32. 'default' => '',
  33. 'desc' => '',
  34. 'match' => 'is_numeric',
  35. 'order' => 'desc',
  36. //'list' => true,
  37. ),
  38. 'uid' => array
  39. (
  40. 'type' => 'int-11',
  41. 'name' => '用户',
  42. 'default' => '0',
  43. 'desc' => '请选择用户',
  44. 'match' => 'is_numeric',
  45. //'update' => 'select',
  46. //'search' => 'select',
  47. 'list' => '{uid} > 0 ? Dever::load("passport/user-one#name", {uid}) : "匿名用户"',
  48. ),
  49. 'info_id' => array
  50. (
  51. 'type' => 'int-11',
  52. 'name' => '所属小程序',
  53. 'default' => '1',
  54. 'desc' => '请选择所属小程序',
  55. 'match' => 'is_numeric',
  56. 'update' => 'select',
  57. 'option' => $info,
  58. 'search' => 'select',
  59. 'list' => '{info_id} > 0 ? Dever::load("set/info-one#name", {info_id}) : "未知"',
  60. ),
  61. 'type' => array
  62. (
  63. 'type' => 'tinyint-1',
  64. 'name' => '操作类型',
  65. 'default' => '',
  66. 'desc' => '操作类型',
  67. 'match' => 'option',
  68. 'option' => $type,
  69. 'list' => true,
  70. ),
  71. 'oper' => array
  72. (
  73. 'type' => 'varchar-30',
  74. 'name' => '具体操作',
  75. 'default' => '',
  76. 'desc' => '请输入具体操作',
  77. 'match' => 'option',
  78. 'update' => 'text',
  79. //'search' => 'fulltext',
  80. 'list' => true,
  81. ),
  82. 'content' => array
  83. (
  84. 'type' => 'text-255',
  85. 'name' => '内容',
  86. 'update' => 'editor',
  87. 'key' => 1,
  88. 'default' => '',
  89. 'desc' => '请输入内容',
  90. 'match' => 'is_string',
  91. 'search' => 'fulltext',
  92. 'list' => 'table',
  93. 'modal' => '查看详情',
  94. ),
  95. 'ua' => array
  96. (
  97. 'type' => 'varchar-800',
  98. 'name' => 'ua',
  99. 'default' => '',
  100. 'desc' => '请输入ua',
  101. 'match' => 'option',
  102. 'update' => 'text',
  103. //'search' => 'fulltext',
  104. 'list' => true,
  105. ),
  106. 'state' => array
  107. (
  108. 'type' => 'tinyint-1',
  109. 'name' => '状态',
  110. 'default' => '1',
  111. 'desc' => '请选择状态',
  112. 'match' => 'is_numeric',
  113. ),
  114. 'cdate' => array
  115. (
  116. 'type' => 'int-11',
  117. 'name' => '录入时间',
  118. 'match' => array('is_numeric', time()),
  119. 'desc' => '',
  120. # 只有insert时才生效
  121. 'insert' => true,
  122. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  123. ),
  124. ),
  125. 'manage' => array
  126. (
  127. 'insert' => false,
  128. 'edit' => false,
  129. ),
  130. # request 请求接口定义
  131. 'request' => array
  132. (
  133. ),
  134. );