town.php 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. <?php
  2. $county = function()
  3. {
  4. $array = array();
  5. $data = Dever::load('area/county-state');
  6. if($data)
  7. {
  8. $array += $data;
  9. }
  10. return $array;
  11. };
  12. $type = array
  13. (
  14. 1 => '普通街镇',
  15. 2 => '国家镇级市',
  16. 3 => '超级街道',
  17. );
  18. return array
  19. (
  20. # 表名
  21. 'name' => 'town',
  22. # 显示给用户看的名称
  23. 'lang' => '街镇',
  24. # 是否显示在后台菜单
  25. 'order' => 60,
  26. 'end' => array
  27. (
  28. 'insert' => 'area/lib/manage.up',
  29. 'update' => 'area/lib/manage.up',
  30. ),
  31. # 数据结构
  32. 'struct' => array
  33. (
  34. 'id' => array
  35. (
  36. 'type' => 'bigint-11',
  37. 'name' => 'ID',
  38. 'default' => '',
  39. 'desc' => '',
  40. 'match' => 'is_numeric',
  41. 'order' => 'asc',
  42. 'list' => true,
  43. ),
  44. 'name' => array
  45. (
  46. 'type' => 'varchar-150',
  47. 'name' => '街道名称',
  48. 'default' => '',
  49. 'desc' => '街道名称',
  50. 'match' => 'is_string',
  51. 'update' => 'text',
  52. 'search' => 'fulltext',
  53. 'list' => true,
  54. ),
  55. 'pinyin' => array
  56. (
  57. 'type' => 'varchar-300',
  58. 'name' => '拼音',
  59. 'default' => '',
  60. 'desc' => '拼音',
  61. 'match' => 'option',
  62. 'update' => 'text',
  63. 'search' => 'fulltext',
  64. 'list' => true,
  65. ),
  66. 'pinyin_first' => array
  67. (
  68. 'type' => 'varchar-30',
  69. 'name' => '拼音首字母',
  70. 'default' => '',
  71. 'desc' => '拼音首字母',
  72. 'match' => 'option',
  73. 'update' => 'text',
  74. 'search' => 'fulltext',
  75. 'list' => true,
  76. ),
  77. 'area' => array
  78. (
  79. 'type' => 'varchar-500',
  80. 'name' => '所在区县',
  81. 'default' => '',
  82. 'desc' => '所在区县',
  83. 'match' => 'option',
  84. 'search' => 'linkage',
  85. 'update' => 'linkage',
  86. 'option' => Dever::url('api.get?level_total=3', 'area'),
  87. 'list' => 'Dever::load("area/api.string", "{area}")',
  88. ),
  89. 'province_id' => array
  90. (
  91. 'type' => 'int-11',
  92. 'name' => '省份',
  93. 'default' => '0',
  94. 'desc' => '省份',
  95. 'match' => 'is_numeric',
  96. //'list' => 'Dever::load("area/province-find#name", {province_id})',
  97. ),
  98. 'city_id' => array
  99. (
  100. 'type' => 'int-11',
  101. 'name' => '城市',
  102. 'default' => '0',
  103. 'desc' => '城市',
  104. 'match' => 'is_numeric',
  105. //'list' => 'Dever::load("area/city-find#name", {city_id})',
  106. ),
  107. 'county_id' => array
  108. (
  109. 'type' => 'int-11',
  110. 'name' => '区县',
  111. 'default' => '0',
  112. 'desc' => '区县',
  113. 'match' => 'is_numeric',
  114. //'update' => 'select',
  115. //'option' => $county,
  116. //'list' => true,
  117. ),
  118. 'type' => array
  119. (
  120. 'type' => 'tinyint-1',
  121. 'name' => '街镇类型',
  122. 'default' => '1',
  123. 'desc' => '街镇类型',
  124. 'match' => 'is_numeric',
  125. 'update' => 'radio',
  126. 'option' => $type,
  127. 'search' => 'select',
  128. 'list' => true,
  129. 'edit' => true,
  130. ),
  131. 'reorder' => array
  132. (
  133. 'type' => 'int-11',
  134. 'name' => '排序(数值越大越靠前)',
  135. 'default' => '1',
  136. 'desc' => '请输入排序',
  137. 'match' => 'option',
  138. 'update' => 'text',
  139. 'search' => 'order',
  140. 'list_name' => '排序',
  141. 'list' => true,
  142. 'order' => 'desc',
  143. 'edit' => true,
  144. ),
  145. 'state' => array
  146. (
  147. 'type' => 'tinyint-1',
  148. 'name' => '状态',
  149. 'default' => '1',
  150. 'desc' => '请选择状态',
  151. 'match' => 'is_numeric',
  152. ),
  153. 'cdate' => array
  154. (
  155. 'type' => 'int-11',
  156. 'name' => '录入时间',
  157. 'match' => array('is_numeric', time()),
  158. 'desc' => '',
  159. # 只有insert时才生效
  160. 'insert' => true,
  161. 'search' => 'date',
  162. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  163. ),
  164. ),
  165. 'manage' => array
  166. (
  167. ),
  168. 'request' => array
  169. (
  170. 'getAll' => array
  171. (
  172. # 匹配的正则或函数 选填项
  173. 'option' => array
  174. (
  175. 'county_id' => 'yes',
  176. 'state' => 1,
  177. ),
  178. 'type' => 'all',
  179. 'order' => array('pinyin_first' => 'asc', 'reorder' => 'desc', 'id' => 'asc'),
  180. 'col' => 'id as value, name, pinyin, pinyin_first',
  181. ),
  182. 'getData' => array
  183. (
  184. # 匹配的正则或函数 选填项
  185. 'option' => array
  186. (
  187. 'county_id' => 'yes',
  188. 'state' => 1,
  189. ),
  190. 'type' => 'all',
  191. 'order' => array('pinyin_first' => 'asc', 'reorder' => 'desc', 'id' => 'asc'),
  192. 'col' => 'id, name, pinyin, pinyin_first|id',
  193. ),
  194. )
  195. );