county.php 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  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' => 'bigint-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. 'price' => array
  142. (
  143. 'type' => 'varchar-15',
  144. 'name' => '区县价值-区县代理价格,以万为单位,负数表示继承城市等级里的价值规则',
  145. 'default' => '-1',
  146. 'desc' => '区县价值',
  147. 'match' => 'is_string',
  148. 'update' => 'text',
  149. 'list' => true,
  150. 'edit' => true,
  151. ),
  152. 'reorder' => array
  153. (
  154. 'type' => 'int-11',
  155. 'name' => '排序(数值越大越靠前)',
  156. 'default' => '1',
  157. 'desc' => '请输入排序',
  158. 'match' => 'option',
  159. 'update' => 'text',
  160. 'search' => 'order',
  161. 'list_name' => '排序',
  162. 'list' => true,
  163. 'order' => 'desc',
  164. 'edit' => true,
  165. ),
  166. 'status' => array
  167. (
  168. 'type' => 'tinyint-1',
  169. 'name' => '状态',
  170. 'default' => '1',
  171. 'desc' => '请选择状态',
  172. 'match' => 'is_numeric',
  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. ),
  197. 'request' => array
  198. (
  199. 'getAll' => array
  200. (
  201. # 匹配的正则或函数 选填项
  202. 'option' => array
  203. (
  204. 'city_id' => 'yes',
  205. 'level' => array('yes', '<'),
  206. 'noid' => array('yes-id', 'not in'),
  207. 'status' => 'yes',
  208. 'state' => 1,
  209. ),
  210. 'type' => 'all',
  211. 'order' => array('pinyin_first' => 'asc', 'reorder' => 'desc', 'id' => 'asc'),
  212. 'col' => 'id as value, name, pinyin, pinyin_first',
  213. ),
  214. 'getData' => array
  215. (
  216. # 匹配的正则或函数 选填项
  217. 'option' => array
  218. (
  219. 'city_id' => 'yes',
  220. 'level' => array('yes', '<'),
  221. 'state' => 1,
  222. ),
  223. 'type' => 'all',
  224. 'order' => array('pinyin_first' => 'asc', 'reorder' => 'desc', 'id' => 'asc'),
  225. 'col' => 'id, name, pinyin, pinyin_first|id',
  226. ),
  227. 'getLike' => array
  228. (
  229. # 匹配的正则或函数 选填项
  230. 'option' => array
  231. (
  232. 'city_id' => 'yes',
  233. 'name' => array('yes', 'like'),
  234. 'state' => 1,
  235. ),
  236. 'type' => 'one',
  237. 'col' => '*',
  238. ),
  239. )
  240. );