town.php 5.8 KB

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