village.php 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  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' => 14,
  20. # 数据结构
  21. 'struct' => array
  22. (
  23. 'id' => array
  24. (
  25. 'type' => 'bigint-11',
  26. 'name' => 'ID',
  27. 'default' => '',
  28. 'desc' => '',
  29. 'match' => 'is_numeric',
  30. 'order' => 'asc',
  31. 'list' => true,
  32. ),
  33. 'name' => array
  34. (
  35. 'type' => 'varchar-150',
  36. 'name' => '社区名称',
  37. 'default' => '',
  38. 'desc' => '社区名称',
  39. 'match' => 'is_string',
  40. 'update' => 'text',
  41. 'search' => 'fulltext',
  42. 'list' => true,
  43. ),
  44. 'pinyin' => array
  45. (
  46. 'type' => 'varchar-300',
  47. 'name' => '拼音',
  48. 'default' => '',
  49. 'desc' => '拼音',
  50. 'match' => 'option',
  51. 'update' => 'text',
  52. 'search' => 'fulltext',
  53. 'list' => true,
  54. ),
  55. 'pinyin_first' => array
  56. (
  57. 'type' => 'varchar-30',
  58. 'name' => '拼音首字母',
  59. 'default' => '',
  60. 'desc' => '拼音首字母',
  61. 'match' => 'option',
  62. 'update' => 'text',
  63. 'search' => 'fulltext',
  64. 'list' => true,
  65. ),
  66. 'code' => array
  67. (
  68. 'type' => 'int-11',
  69. 'name' => '城乡分类代码',
  70. 'default' => '',
  71. 'desc' => '城乡分类代码',
  72. 'match' => 'is_numeric',
  73. 'update' => 'text',
  74. 'search' => 'fulltext',
  75. 'list' => true,
  76. ),
  77. 'town_id' => array
  78. (
  79. 'type' => 'int-11',
  80. 'name' => '街道',
  81. 'default' => '0',
  82. 'desc' => '街道',
  83. 'match' => 'is_numeric',
  84. 'update' => 'select',
  85. 'option' => $town,
  86. 'list' => true,
  87. ),
  88. 'reorder' => array
  89. (
  90. 'type' => 'int-11',
  91. 'name' => '排序(数值越大越靠前)',
  92. 'default' => '1',
  93. 'desc' => '请输入排序',
  94. 'match' => 'option',
  95. 'update' => 'text',
  96. 'search' => 'order',
  97. 'list_name' => '排序',
  98. 'list' => true,
  99. 'order' => 'desc',
  100. 'edit' => true,
  101. ),
  102. 'state' => array
  103. (
  104. 'type' => 'tinyint-1',
  105. 'name' => '状态',
  106. 'default' => '1',
  107. 'desc' => '请选择状态',
  108. 'match' => 'is_numeric',
  109. ),
  110. 'cdate' => array
  111. (
  112. 'type' => 'int-11',
  113. 'name' => '录入时间',
  114. 'match' => array('is_numeric', time()),
  115. 'desc' => '',
  116. # 只有insert时才生效
  117. 'insert' => true,
  118. 'search' => 'date',
  119. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  120. ),
  121. ),
  122. 'manage' => array
  123. (
  124. ),
  125. 'request' => array
  126. (
  127. 'getAll' => array
  128. (
  129. # 匹配的正则或函数 选填项
  130. 'option' => array
  131. (
  132. 'town_id' => 'yes',
  133. 'state' => 1,
  134. ),
  135. 'type' => 'all',
  136. 'order' => array('pinyin_first' => 'asc', 'reorder' => 'desc', 'id' => 'asc'),
  137. 'col' => 'id as value, name, pinyin, pinyin_first',
  138. ),
  139. 'getData' => array
  140. (
  141. # 匹配的正则或函数 选填项
  142. 'option' => array
  143. (
  144. 'town_id' => 'yes',
  145. 'state' => 1,
  146. ),
  147. 'type' => 'all',
  148. 'order' => array('pinyin_first' => 'asc', 'reorder' => 'desc', 'id' => 'asc'),
  149. 'col' => 'id, name, pinyin, pinyin_first|id',
  150. ),
  151. )
  152. );