data.php 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. <?php
  2. # 定义几个常用的选项
  3. $option = array
  4. (
  5. 1 => '正常',
  6. 2 => '删除',
  7. );
  8. return array
  9. (
  10. # 表名
  11. 'name' => 'data',
  12. # 显示给用户看的名称
  13. 'lang' => '数据管理',
  14. # 后台菜单排序
  15. 'order' => 6,
  16. # 数据结构
  17. 'struct' => array
  18. (
  19. 'id' => array
  20. (
  21. 'type' => 'int-11',
  22. 'name' => 'ID',
  23. 'default' => '',
  24. 'desc' => '',
  25. 'match' => 'is_numeric',
  26. 'search' => 'order',
  27. 'list' => true,
  28. 'order' => 'desc',
  29. ),
  30. 'source_link' => array
  31. (
  32. 'type' => 'varchar-300',
  33. 'name' => '来源网址',
  34. 'default' => '',
  35. 'desc' => '来源网址',
  36. 'match' => 'is_string',
  37. //'update' => 'text',
  38. //'search' => 'fulltext',
  39. 'list' => true,
  40. ),
  41. 'source_list' => array
  42. (
  43. 'type' => 'varchar-300',
  44. 'name' => '来源网址所属列表页',
  45. 'default' => '',
  46. 'desc' => '来源网址所属列表页',
  47. 'match' => 'is_string',
  48. //'update' => 'text',
  49. //'search' => 'fulltext',
  50. //'list' => true,
  51. ),
  52. 'name' => array
  53. (
  54. 'type' => 'varchar-300',
  55. 'name' => '标题',
  56. 'default' => '',
  57. 'desc' => '请输入标题',
  58. 'match' => 'is_string',
  59. 'update' => 'text',
  60. 'search' => 'fulltext',
  61. 'list' => true,
  62. 'edit' => 'textarea',
  63. ),
  64. 'cate_id' => array
  65. (
  66. 'type' => 'int-11',
  67. 'name' => '分类id',
  68. 'default' => '1',
  69. 'desc' => '请选择分类id',
  70. 'match' => 'is_numeric',
  71. 'search' => 'order',
  72. 'list' => '{cate_id} > 0 ? Dever::load("collect/cate-one#name", {cate_id}) : "无"',
  73. # 开启显示控制,可以控制下边的表单
  74. //'show' => 'cate_id',
  75. ),
  76. 'config_id' => array
  77. (
  78. 'type' => 'int-11',
  79. 'name' => '配置id',
  80. 'default' => '1',
  81. 'desc' => '请选择配置id',
  82. 'match' => 'is_numeric',
  83. 'search' => 'order',
  84. //'list' => '{config_id} > 0 ? Dever::load("collect/config-one#name", {config_id}) : "无"',
  85. # 开启显示控制,可以控制下边的表单
  86. //'show' => 'cate_id',
  87. ),
  88. 'info' => array
  89. (
  90. 'type' => 'varchar-500',
  91. 'name' => '摘要',
  92. 'default' => '',
  93. 'desc' => '请输入摘要',
  94. 'match' => 'is_string',
  95. 'update' => 'textarea',
  96. //'edit' => true,
  97. ),
  98. 'content' => array
  99. (
  100. 'type' => 'text-1000',
  101. 'name' => '内容',
  102. 'default' => '',
  103. 'desc' => '请输入内容',
  104. 'match' => 'is_string',
  105. 'update' => 'editor',
  106. 'key' => 1,
  107. ),
  108. 'extend' => array
  109. (
  110. 'type' => 'text-1000',
  111. 'name' => '扩展信息',
  112. 'default' => '',
  113. 'desc' => '请扩展信息',
  114. 'match' => 'is_string',
  115. 'update' => 'textarea',
  116. //'list' => true,
  117. ),
  118. 'state' => array
  119. (
  120. 'type' => 'tinyint-1',
  121. 'name' => '数据状态',
  122. 'default' => '1',
  123. 'desc' => '请选择状态',
  124. 'match' => 'is_numeric',
  125. 'option' => $option,
  126. //'update' => 'radio',
  127. ),
  128. 'cdate' => array
  129. (
  130. 'type' => 'int-11',
  131. 'name' => '录入时间',
  132. 'match' => array('is_numeric', time()),
  133. 'desc' => '',
  134. # 只有insert时才生效
  135. //'insert' => true,
  136. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  137. ),
  138. ),
  139. 'manage' => array
  140. (
  141. # 开启批量管理
  142. 'mul' => true,
  143. 'insert' => false,
  144. 'list_button' => array(6 => '删除'),
  145. ),
  146. # request 请求接口定义
  147. 'request' => array
  148. (
  149. # 更新浏览量
  150. 'addView' => array
  151. (
  152. 'type' => 'update',
  153. 'where' => array
  154. (
  155. 'id' => 'yes',
  156. ),
  157. 'set' => array
  158. (
  159. 'num_view' => array('1', '+='),
  160. ),
  161. ),
  162. 'getAll' => array
  163. (
  164. # 匹配的正则或函数 选填项
  165. 'option' => array
  166. (
  167. 'config_id' => 'yes',
  168. 'state' => 1,
  169. ),
  170. 'type' => 'all',
  171. 'order' => array('id', 'asc'),
  172. ),
  173. ),
  174. );