data.php 4.1 KB

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