county.php 5.8 KB

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