village.php 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  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. 'code' => array
  45. (
  46. 'type' => 'int-11',
  47. 'name' => '城乡分类代码',
  48. 'default' => '',
  49. 'desc' => '城乡分类代码',
  50. 'match' => 'is_numeric',
  51. 'update' => 'text',
  52. 'search' => 'fulltext',
  53. 'list' => true,
  54. ),
  55. 'town_id' => array
  56. (
  57. 'type' => 'int-11',
  58. 'name' => '街道',
  59. 'default' => '0',
  60. 'desc' => '街道',
  61. 'match' => 'is_numeric',
  62. 'update' => 'select',
  63. 'option' => $town,
  64. 'list' => true,
  65. ),
  66. 'reorder' => array
  67. (
  68. 'type' => 'int-11',
  69. 'name' => '排序(数值越大越靠前)',
  70. 'default' => '1',
  71. 'desc' => '请输入排序',
  72. 'match' => 'option',
  73. 'update' => 'text',
  74. 'search' => 'order',
  75. 'list_name' => '排序',
  76. 'list' => true,
  77. 'order' => 'desc',
  78. 'edit' => true,
  79. ),
  80. 'state' => array
  81. (
  82. 'type' => 'tinyint-1',
  83. 'name' => '状态',
  84. 'default' => '1',
  85. 'desc' => '请选择状态',
  86. 'match' => 'is_numeric',
  87. ),
  88. 'cdate' => array
  89. (
  90. 'type' => 'int-11',
  91. 'name' => '录入时间',
  92. 'match' => array('is_numeric', time()),
  93. 'desc' => '',
  94. # 只有insert时才生效
  95. 'insert' => true,
  96. 'search' => 'date',
  97. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  98. ),
  99. ),
  100. 'manage' => array
  101. (
  102. ),
  103. 'request' => array
  104. (
  105. 'getAll' => array
  106. (
  107. # 匹配的正则或函数 选填项
  108. 'option' => array
  109. (
  110. 'town_id' => 'yes',
  111. 'state' => 1,
  112. ),
  113. 'type' => 'all',
  114. 'order' => array('reorder' => 'desc', 'id' => 'asc'),
  115. 'col' => 'id as value, name',
  116. ),
  117. 'getData' => array
  118. (
  119. # 匹配的正则或函数 选填项
  120. 'option' => array
  121. (
  122. 'town_id' => 'yes',
  123. 'state' => 1,
  124. ),
  125. 'type' => 'all',
  126. 'order' => array('reorder' => 'desc', 'id' => 'asc'),
  127. 'col' => 'id, name|id',
  128. ),
  129. )
  130. );