county.php 4.6 KB

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