info.php 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. <?php
  2. $cate = function()
  3. {
  4. $array = array();
  5. $cate = Dever::config('base')->tagCate;
  6. if (!$cate) {
  7. $cate = 'tag/cate';
  8. }
  9. $info = Dever::db($cate)->state();
  10. if($info)
  11. {
  12. $array += $info;
  13. }
  14. return $array;
  15. };
  16. return array
  17. (
  18. # 表名
  19. 'name' => 'info',
  20. # 显示给用户看的名称
  21. 'lang' => '标签列表',
  22. # 是否显示在后台菜单
  23. 'order' => 10,
  24. # 数据结构
  25. 'struct' => array
  26. (
  27. 'id' => array
  28. (
  29. 'type' => 'int-11',
  30. 'name' => 'ID',
  31. 'default' => '',
  32. 'desc' => '',
  33. 'match' => 'is_numeric',
  34. 'order' => 'asc',
  35. 'list' => true,
  36. ),
  37. 'name' => array
  38. (
  39. 'type' => 'varchar-150',
  40. 'name' => '标签名称',
  41. 'default' => '',
  42. 'desc' => '标签名称',
  43. 'match' => 'is_string',
  44. 'update' => 'text',
  45. 'search' => 'fulltext',
  46. 'list' => true,
  47. 'edit' => true,
  48. ),
  49. 'color' => array
  50. (
  51. 'type' => 'varchar-10',
  52. 'name' => '颜色-请填写颜色代码',
  53. 'default' => '',
  54. 'desc' => '颜色',
  55. 'match' => 'option',
  56. 'update' => 'text',
  57. ),
  58. 'icon' => array
  59. (
  60. 'type' => 'varchar-150',
  61. 'name' => '图标',
  62. 'default' => '',
  63. 'desc' => '请选择图标',
  64. 'match' => 'option',
  65. 'update' => 'image',
  66. 'key' => '1',
  67. 'place' => '150',
  68. ),
  69. 'cate_id' => array
  70. (
  71. 'type' => 'int-11',
  72. 'name' => '选择分类',
  73. 'default' => '1',
  74. 'desc' => '选择分类',
  75. 'match' => 'is_numeric',
  76. 'update' => 'select',
  77. 'option' => $cate,
  78. 'list' => true,
  79. ),
  80. 'reorder' => array
  81. (
  82. 'type' => 'int-11',
  83. 'name' => '排序(数值越大越靠前)',
  84. 'default' => '1',
  85. 'desc' => '请输入排序',
  86. 'match' => 'option',
  87. 'update' => 'text',
  88. 'search' => 'order',
  89. 'list_name' => '排序',
  90. 'list' => true,
  91. 'order' => 'desc',
  92. 'edit' => true,
  93. ),
  94. 'state' => array
  95. (
  96. 'type' => 'tinyint-1',
  97. 'name' => '状态',
  98. 'default' => '1',
  99. 'desc' => '请选择状态',
  100. 'match' => 'is_numeric',
  101. ),
  102. 'cdate' => array
  103. (
  104. 'type' => 'int-11',
  105. 'name' => '录入时间',
  106. 'match' => array('is_numeric', time()),
  107. 'desc' => '',
  108. # 只有insert时才生效
  109. 'insert' => true,
  110. 'search' => 'date',
  111. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  112. ),
  113. ),
  114. 'manage' => array
  115. (
  116. # 列表页的类型
  117. 'button' => array
  118. (
  119. '标签分类' => array('list', 'cate&oper_parent=info&oper_project=tag'),
  120. ),
  121. ),
  122. 'request' => array
  123. (
  124. 'getAll' => array
  125. (
  126. # 匹配的正则或函数 选填项
  127. 'option' => array
  128. (
  129. 'ids' => array('yes-id', 'in'),
  130. 'cate_id' => 'yes',
  131. 'name' => array('yes', 'like'),
  132. 'id' => 'yes',
  133. 'state' => 1,
  134. ),
  135. 'type' => 'all',
  136. 'order' => array('reorder' => 'desc', 'id' => 'desc'),
  137. 'limit' => '0,1000',
  138. 'col' => 'name as name, id, id as value, "" as selected, "" as disabled|id',
  139. ),
  140. 'getAllByIds' => array
  141. (
  142. # 匹配的正则或函数 选填项
  143. 'option' => array
  144. (
  145. 'ids' => array('yes-id', 'in'),
  146. 'state' => 1,
  147. ),
  148. 'type' => 'all',
  149. 'order' => array('reorder' => 'desc', 'id' => 'desc'),
  150. 'col' => '*',
  151. ),
  152. 'getAllByName' => array
  153. (
  154. # 匹配的正则或函数 选填项
  155. 'option' => array
  156. (
  157. 'name' => array('yes', 'like'),
  158. 'state' => 1,
  159. ),
  160. 'type' => 'all',
  161. 'order' => array('reorder' => 'desc', 'id' => 'desc'),
  162. 'col' => '*,name as value,name as label|id',
  163. ),
  164. 'getAllByCate' => array
  165. (
  166. # 匹配的正则或函数 选填项
  167. 'option' => array
  168. (
  169. 'cate_id' => 'yes',
  170. 'state' => 1,
  171. ),
  172. 'type' => 'all',
  173. 'order' => array('reorder' => 'desc', 'id' => 'desc'),
  174. 'col' => 'id,name',
  175. ),
  176. 'getList' => array
  177. (
  178. # 匹配的正则或函数 选填项
  179. 'option' => array
  180. (
  181. 'cate_id' => 'yes',
  182. 'state' => 1,
  183. ),
  184. 'type' => 'all',
  185. 'order' => array('reorder' => 'desc', 'id' => 'desc'),
  186. 'limit' => '0,15',
  187. 'col' => 'id,name',
  188. ),
  189. )
  190. );