village.php 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. <?php
  2. $town = function()
  3. {
  4. $array = array();
  5. $data = Dever::load('area/town-state');
  6. if($data)
  7. {
  8. $array += $data;
  9. }
  10. return $array;
  11. };
  12. return array
  13. (
  14. # 表名
  15. 'name' => 'village',
  16. # 显示给用户看的名称
  17. 'lang' => '社区',
  18. # 是否显示在后台菜单
  19. 'order' => 50,
  20. 'menu' => false,
  21. 'end' => array
  22. (
  23. 'insert' => 'area/lib/manage.up',
  24. 'update' => 'area/lib/manage.up',
  25. ),
  26. # 数据结构
  27. 'struct' => array
  28. (
  29. 'id' => array
  30. (
  31. 'type' => 'bigint-11',
  32. 'name' => 'ID',
  33. 'default' => '',
  34. 'desc' => '',
  35. 'match' => 'is_numeric',
  36. 'order' => 'asc',
  37. 'list' => true,
  38. ),
  39. 'name' => array
  40. (
  41. 'type' => 'varchar-150',
  42. 'name' => '社区名称',
  43. 'default' => '',
  44. 'desc' => '社区名称',
  45. 'match' => 'is_string',
  46. 'update' => 'text',
  47. 'search' => 'fulltext',
  48. 'list' => true,
  49. ),
  50. 'pinyin' => array
  51. (
  52. 'type' => 'varchar-300',
  53. 'name' => '拼音',
  54. 'default' => '',
  55. 'desc' => '拼音',
  56. 'match' => 'option',
  57. 'update' => 'text',
  58. 'search' => 'fulltext',
  59. 'list' => true,
  60. ),
  61. 'pinyin_first' => array
  62. (
  63. 'type' => 'varchar-30',
  64. 'name' => '拼音首字母',
  65. 'default' => '',
  66. 'desc' => '拼音首字母',
  67. 'match' => 'option',
  68. 'update' => 'text',
  69. 'search' => 'fulltext',
  70. 'list' => true,
  71. ),
  72. 'code' => array
  73. (
  74. 'type' => 'int-11',
  75. 'name' => '城乡分类代码',
  76. 'default' => '',
  77. 'desc' => '城乡分类代码',
  78. 'match' => 'is_numeric',
  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=4', '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. 'town_id' => array
  125. (
  126. 'type' => 'int-11',
  127. 'name' => '街道',
  128. 'default' => '0',
  129. 'desc' => '街道',
  130. 'match' => 'is_numeric',
  131. //'update' => 'select',
  132. //'option' => $town,
  133. //'list' => true,
  134. ),
  135. 'reorder' => array
  136. (
  137. 'type' => 'int-11',
  138. 'name' => '排序(数值越大越靠前)',
  139. 'default' => '1',
  140. 'desc' => '请输入排序',
  141. 'match' => 'option',
  142. 'update' => 'text',
  143. 'search' => 'order',
  144. 'list_name' => '排序',
  145. 'list' => true,
  146. 'order' => 'desc',
  147. 'edit' => true,
  148. ),
  149. 'state' => array
  150. (
  151. 'type' => 'tinyint-1',
  152. 'name' => '状态',
  153. 'default' => '1',
  154. 'desc' => '请选择状态',
  155. 'match' => 'is_numeric',
  156. ),
  157. 'cdate' => array
  158. (
  159. 'type' => 'int-11',
  160. 'name' => '录入时间',
  161. 'match' => array('is_numeric', time()),
  162. 'desc' => '',
  163. # 只有insert时才生效
  164. 'insert' => true,
  165. 'search' => 'date',
  166. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  167. ),
  168. ),
  169. 'manage' => array
  170. (
  171. ),
  172. 'request' => array
  173. (
  174. 'getAll' => array
  175. (
  176. # 匹配的正则或函数 选填项
  177. 'option' => array
  178. (
  179. 'town_id' => 'yes',
  180. 'noid' => array('yes-id', 'not in'),
  181. 'state' => 1,
  182. ),
  183. 'type' => 'all',
  184. 'order' => array('pinyin_first' => 'asc', 'reorder' => 'desc', 'id' => 'asc'),
  185. 'col' => 'id as value, name, pinyin, pinyin_first',
  186. ),
  187. 'getData' => array
  188. (
  189. # 匹配的正则或函数 选填项
  190. 'option' => array
  191. (
  192. 'town_id' => 'yes',
  193. 'state' => 1,
  194. ),
  195. 'type' => 'all',
  196. 'order' => array('pinyin_first' => 'asc', 'reorder' => 'desc', 'id' => 'asc'),
  197. 'col' => 'id, name, pinyin, pinyin_first|id',
  198. ),
  199. )
  200. );