town.php 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279
  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. $status = array
  19. (
  20. 1 => '未占用',
  21. 2 => '已占用',
  22. );
  23. return array
  24. (
  25. # 表名
  26. 'name' => 'town',
  27. # 显示给用户看的名称
  28. 'lang' => '街镇',
  29. # 是否显示在后台菜单
  30. 'order' => 60,
  31. 'end' => array
  32. (
  33. 'insert' => 'area/lib/manage.up',
  34. 'update' => 'area/lib/manage.up',
  35. ),
  36. # 数据结构
  37. 'struct' => array
  38. (
  39. 'id' => array
  40. (
  41. 'type' => 'bigint-11',
  42. 'name' => 'ID',
  43. 'default' => '',
  44. 'desc' => '',
  45. 'match' => 'is_numeric',
  46. 'order' => 'asc',
  47. 'list' => true,
  48. 'update' => 'text',
  49. ),
  50. 'name' => array
  51. (
  52. 'type' => 'varchar-150',
  53. 'name' => '街道名称',
  54. 'default' => '',
  55. 'desc' => '街道名称',
  56. 'match' => 'is_string',
  57. 'update' => 'text',
  58. 'search' => 'fulltext',
  59. 'list' => true,
  60. ),
  61. 'pinyin' => array
  62. (
  63. 'type' => 'varchar-300',
  64. 'name' => '拼音',
  65. 'default' => '',
  66. 'desc' => '拼音',
  67. 'match' => 'option',
  68. 'update' => 'text',
  69. 'search' => 'fulltext',
  70. 'list' => true,
  71. ),
  72. 'pinyin_first' => array
  73. (
  74. 'type' => 'varchar-30',
  75. 'name' => '拼音首字母',
  76. 'default' => '',
  77. 'desc' => '拼音首字母',
  78. 'match' => 'option',
  79. 'update' => 'text',
  80. 'search' => 'fulltext',
  81. 'list' => true,
  82. ),
  83. 'area' => array
  84. (
  85. 'type' => 'varchar-500',
  86. 'name' => '所在区县',
  87. 'default' => '',
  88. 'desc' => '所在区县',
  89. 'match' => 'option',
  90. 'search' => 'linkage',
  91. 'update' => 'linkage',
  92. 'option' => Dever::url('api.get?level_total=3', 'area'),
  93. 'list' => 'Dever::load("area/api.string", "{area}")',
  94. ),
  95. 'province_id' => array
  96. (
  97. 'type' => 'int-11',
  98. 'name' => '省份',
  99. 'default' => '0',
  100. 'desc' => '省份',
  101. 'match' => 'is_numeric',
  102. //'list' => 'Dever::load("area/province-find#name", {province_id})',
  103. ),
  104. 'city_id' => array
  105. (
  106. 'type' => 'int-11',
  107. 'name' => '城市',
  108. 'default' => '0',
  109. 'desc' => '城市',
  110. 'match' => 'is_numeric',
  111. //'list' => 'Dever::load("area/city-find#name", {city_id})',
  112. ),
  113. 'county_id' => array
  114. (
  115. 'type' => 'int-11',
  116. 'name' => '区县',
  117. 'default' => '0',
  118. 'desc' => '区县',
  119. 'match' => 'is_numeric',
  120. //'update' => 'select',
  121. //'option' => $county,
  122. //'list' => true,
  123. ),
  124. 'type' => array
  125. (
  126. 'type' => 'tinyint-1',
  127. 'name' => '街镇类型',
  128. 'default' => '1',
  129. 'desc' => '街镇类型',
  130. 'match' => 'is_numeric',
  131. 'update' => 'radio',
  132. 'option' => $type,
  133. 'search' => 'select',
  134. 'list' => true,
  135. 'edit' => true,
  136. ),
  137. 'price' => array
  138. (
  139. 'type' => 'varchar-15',
  140. 'name' => '街道价值-街道代理价格,以万为单位,负数表示继承城市等级里的价值规则',
  141. 'default' => '-1',
  142. 'desc' => '街道价值',
  143. 'match' => 'is_string',
  144. 'update' => 'text',
  145. 'list' => true,
  146. 'edit' => true,
  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_name' => '排序',
  158. 'list' => true,
  159. 'order' => 'desc',
  160. 'edit' => true,
  161. ),
  162. 'status' => array
  163. (
  164. 'type' => 'tinyint-1',
  165. 'name' => '状态',
  166. 'default' => '1',
  167. 'desc' => '请选择状态',
  168. 'match' => 'is_numeric',
  169. 'list' => true,
  170. 'edit' => true,
  171. 'search' => 'select',
  172. 'option' => $status,
  173. ),
  174. 'state' => array
  175. (
  176. 'type' => 'tinyint-1',
  177. 'name' => '状态',
  178. 'default' => '1',
  179. 'desc' => '请选择状态',
  180. 'match' => 'is_numeric',
  181. ),
  182. 'cdate' => array
  183. (
  184. 'type' => 'int-11',
  185. 'name' => '录入时间',
  186. 'match' => array('is_numeric', time()),
  187. 'desc' => '',
  188. # 只有insert时才生效
  189. 'insert' => true,
  190. 'search' => 'date',
  191. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  192. ),
  193. ),
  194. 'manage' => array
  195. (
  196. 'excel' => array
  197. (
  198. array('数据导出', '街道列表', 'area/lib/manage.outTown'),
  199. ),
  200. ),
  201. 'request' => array
  202. (
  203. 'getTotal' => array
  204. (
  205. # 匹配的正则或函数 选填项
  206. 'option' => array
  207. (
  208. 'county_id' => 'yes',
  209. 'type' => array('yes', '>'),
  210. 'state' => 1,
  211. ),
  212. 'type' => 'count',
  213. 'col' => '*',
  214. ),
  215. 'getAll' => array
  216. (
  217. # 匹配的正则或函数 选填项
  218. 'option' => array
  219. (
  220. 'county_id' => 'yes',
  221. 'type' => array('yes', '>'),
  222. 'price' => array('yes', '>'),
  223. 'noid' => array('yes-id', 'not in'),
  224. 'status' => 'yes',
  225. 'state' => 1,
  226. ),
  227. 'type' => 'all',
  228. 'order' => array('pinyin_first' => 'asc', 'reorder' => 'desc', 'id' => 'asc'),
  229. 'col' => 'id as value, name, pinyin, pinyin_first',
  230. ),
  231. 'getData' => array
  232. (
  233. # 匹配的正则或函数 选填项
  234. 'option' => array
  235. (
  236. 'county_id' => 'yes',
  237. 'type' => array('yes', '>'),
  238. 'state' => 1,
  239. ),
  240. 'type' => 'all',
  241. 'order' => array('pinyin_first' => 'asc', 'reorder' => 'desc', 'id' => 'asc'),
  242. 'col' => 'id, name, pinyin, pinyin_first|id',
  243. ),
  244. 'getLike' => array
  245. (
  246. # 匹配的正则或函数 选填项
  247. 'option' => array
  248. (
  249. 'county_id' => 'yes',
  250. 'name' => array('yes', 'like'),
  251. 'state' => 1,
  252. ),
  253. 'type' => 'one',
  254. 'col' => '*',
  255. ),
  256. )
  257. );