town.php 5.9 KB

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