help.php 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. <?php
  2. /*
  3. |--------------------------------------------------------------------------
  4. | admin.php 管理员表
  5. |--------------------------------------------------------------------------
  6. */
  7. # 定义几个常用的选项
  8. $option = array
  9. (
  10. 1 => '启用',
  11. 2 => '关闭',
  12. );
  13. $config = function()
  14. {
  15. return Dever::load('manage/config-all');
  16. };
  17. return array
  18. (
  19. # 表名
  20. 'name' => 'help',
  21. # 显示给用户看的名称
  22. 'lang' => '后台帮助',
  23. 'order' => 68,
  24. 'menu' => false,
  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. 'search' => 'order',
  36. 'list' => true,
  37. 'order' => 'desc',
  38. ),
  39. 'name' => array
  40. (
  41. 'type' => 'varchar-32',
  42. 'name' => '帮助标题',
  43. 'default' => '',
  44. 'desc' => '请输入帮助标题',
  45. 'match' => 'is_string',
  46. 'update' => 'text',
  47. //'autocomplete' => 'auth.role?json=1',
  48. 'search' => 'order,fulltext',
  49. 'list' => true,
  50. ),
  51. 'config' => array
  52. (
  53. 'type' => 'int-11',
  54. 'name' => '后台配置',
  55. 'default' => '1',
  56. 'desc' => '请选择后台配置',
  57. 'match' => 'is_numeric',
  58. 'option' => $config,
  59. 'update' => 'select',
  60. 'list' => true,
  61. ),
  62. 'reorder' => array
  63. (
  64. 'type' => 'int-11',
  65. 'name' => '排序(数值越大越靠前)',
  66. 'default' => '1',
  67. 'desc' => '请输入排序',
  68. 'match' => 'option',
  69. 'update' => 'text',
  70. 'search' => 'order',
  71. 'list' => true,
  72. 'order' => 'desc',
  73. ),
  74. 'video' => array
  75. (
  76. 'type' => 'varchar-800',
  77. 'name' => '帮助视频-视频格式mp4,上传大小不能超过4G',
  78. 'default' => '',
  79. 'desc' => '帮助视频',
  80. 'match' => 'option',
  81. 'update' => 'video',
  82. 'key' => '3',
  83. 'place' => '150',
  84. 'upload' => 'yun',
  85. 'large' => true,
  86. //'cover' => 'pic',//封面图字段名
  87. ),
  88. 'content' => array
  89. (
  90. 'type' => 'text-255',
  91. 'name' => '内容',
  92. 'default' => '',
  93. 'desc' => '请输入内容',
  94. 'match' => 'option',
  95. 'update' => 'editor',
  96. //'list' => true,
  97. 'key' => 1,
  98. ),
  99. 'state' => array
  100. (
  101. 'type' => 'tinyint-1',
  102. 'name' => '状态',
  103. 'default' => '1',
  104. 'desc' => '请选择状态',
  105. 'match' => 'is_numeric',
  106. ),
  107. 'cdate' => array
  108. (
  109. 'type' => 'int-11',
  110. 'name' => '录入时间',
  111. 'match' => array('is_numeric', time()),
  112. 'desc' => '',
  113. # 只有insert时才生效
  114. 'insert' => true,
  115. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  116. ),
  117. ),
  118. 'manage' => array
  119. (
  120. # 增加批量更新功能,根据哪个字段批量更新
  121. 'update_mul' => 'name',
  122. ),
  123. # request 请求接口定义
  124. 'request' => array
  125. (
  126. # 根据配置id获取notice
  127. 'getAll' => array
  128. (
  129. # 匹配的正则或函数 必填项
  130. 'where' => array
  131. (
  132. //'username' => '/^([A-Za-z0-9])/',
  133. 'config' => 'yes',
  134. 'state' => 1,
  135. ),
  136. 'type' => 'all',
  137. 'order' => array('id' => 'desc'),
  138. 'limit' => '0,5',
  139. 'col' => '*',
  140. ),
  141. # 根据配置id和notice Id获取
  142. 'getOne' => array
  143. (
  144. 'type' => 'one',
  145. 'where' => array
  146. (
  147. 'id' => 'yes',
  148. 'config' => 'yes',
  149. 'state' => 1,
  150. ),
  151. 'input' => true,
  152. ),
  153. ),
  154. );