data.php 4.9 KB

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