help.php 4.4 KB

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