data.php 4.2 KB

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