data.php 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. <?php
  2. $type = Dever::config('base')->type;
  3. $audit = Dever::config('base')->audit;
  4. $status = Dever::config('base')->status;
  5. return array
  6. (
  7. # 表名
  8. 'name' => 'data',
  9. # 显示给用户看的名称
  10. 'lang' => '审核管理',
  11. # 后台菜单排序
  12. 'order' => 7,
  13. 'menu' => 'content',
  14. 'end' => array
  15. (
  16. 'update_audit' => 'audit/lib/core.audit',
  17. 'update_status' => 'audit/lib/core.status',
  18. ),
  19. # 数据结构
  20. 'struct' => array
  21. (
  22. 'id' => array
  23. (
  24. 'type' => 'int-11',
  25. 'name' => 'ID',
  26. 'default' => '',
  27. 'desc' => '',
  28. 'match' => 'is_numeric',
  29. 'search' => 'order',
  30. //'list' => true,
  31. 'order' => 'desc',
  32. ),
  33. 'type' => array
  34. (
  35. 'type' => 'int-11',
  36. 'name' => '类型',
  37. 'default' => '1',
  38. 'desc' => '类型',
  39. 'match' => 'is_numeric',
  40. 'update' => 'radio',
  41. 'option' => $type,
  42. 'search' => 'select',
  43. 'list' => true,
  44. //'edit' => true,
  45. ),
  46. 'data_id' => array
  47. (
  48. 'type' => 'varchar-80',
  49. 'name' => '数据ID',
  50. 'default' => '',
  51. 'desc' => '数据id',
  52. 'match' => 'is_string',
  53. 'update' => 'text',
  54. //'search' => 'fulltext',
  55. //'list' => true,
  56. ),
  57. 'name' => array
  58. (
  59. 'type' => 'varchar-80',
  60. 'name' => '标题',
  61. 'default' => '',
  62. 'desc' => '标题',
  63. 'match' => 'is_string',
  64. 'update' => 'text',
  65. 'search' => 'fulltext',
  66. 'list' => true,
  67. ),
  68. 'audit' => array
  69. (
  70. 'type' => 'int-11',
  71. 'name' => '审核状态',
  72. 'default' => '1',
  73. 'desc' => '审核',
  74. 'match' => 'is_numeric',
  75. 'update' => 'select',
  76. 'option' => $audit,
  77. 'search' => 'select',
  78. 'list' => true,
  79. 'edit' => true,
  80. ),
  81. 'status' => array
  82. (
  83. 'type' => 'int-11',
  84. 'name' => '发布状态',
  85. 'default' => '1',
  86. 'desc' => '发布状态',
  87. 'match' => 'is_numeric',
  88. //'update' => 'select',
  89. 'option' => $status,
  90. 'search' => 'select',
  91. 'list' => true,
  92. 'edit' => true,
  93. ),
  94. 'pdate' => array
  95. (
  96. 'type' => 'int-11',
  97. 'name' => '发布时间',
  98. 'match' => 'is_numeric',
  99. 'default' => '',
  100. 'desc' => '',
  101. 'update' => 'date',
  102. 'callback' => 'maketime',
  103. 'list' => 'date("Y-m-d H:i:s", {pdate})',
  104. ),
  105. 'reorder' => array
  106. (
  107. 'type' => 'int-11',
  108. 'name' => '排序(数值越大越靠前)',
  109. 'default' => '1',
  110. 'desc' => '请输入排序',
  111. 'match' => 'option',
  112. 'update' => 'text',
  113. 'search' => 'order',
  114. 'list' => true,
  115. 'order' => 'desc',
  116. //'edit' => true,
  117. ),
  118. 'state' => array
  119. (
  120. 'type' => 'tinyint-1',
  121. 'name' => '状态',
  122. 'default' => '1',
  123. 'desc' => '请选择状态',
  124. 'match' => 'is_numeric',
  125. 'edit' => false,
  126. ),
  127. 'cdate' => array
  128. (
  129. 'type' => 'int-11',
  130. 'name' => '录入时间',
  131. 'match' => array('is_numeric', time()),
  132. 'desc' => '',
  133. # 只有insert时才生效
  134. 'insert' => true,
  135. //'list' => 'date("Y-m-d H:i:s", {cdate})',
  136. ),
  137. ),
  138. 'manage' => array
  139. (
  140. 'delete' => false,
  141. 'edit' => false,
  142. 'insert' => false,
  143. 'mul' => true,
  144. 'list_button' => array
  145. (
  146. 'edit' => array('预览', Dever::url('main/preview.get?audit=1')),
  147. ),
  148. ),
  149. # request 请求接口定义
  150. 'request' => array
  151. (
  152. 'getAll' => array
  153. (
  154. # 匹配的正则或函数 选填项
  155. 'option' => array
  156. (
  157. 'audit' => 2,
  158. 'status' => 2,
  159. 'state' => 1,
  160. ),
  161. 'type' => 'all',
  162. 'order' => array('reorder' => 'desc','id' => 'desc'),
  163. 'page' => array(15, 'list'),
  164. 'col' => '*',
  165. ),
  166. )
  167. );