city.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. <?php
  2. $province = function()
  3. {
  4. $array = array();
  5. $data = Dever::load('area/province-state');
  6. if($data)
  7. {
  8. $array += $data;
  9. }
  10. return $array;
  11. };
  12. return array
  13. (
  14. # 表名
  15. 'name' => 'city',
  16. # 显示给用户看的名称
  17. 'lang' => '城市',
  18. # 是否显示在后台菜单
  19. 'order' => 11,
  20. # 数据结构
  21. 'struct' => array
  22. (
  23. 'id' => array
  24. (
  25. 'type' => 'int-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-50',
  36. 'name' => '城市名称',
  37. 'default' => '',
  38. 'desc' => '城市名称',
  39. 'match' => 'is_string',
  40. 'update' => 'text',
  41. 'search' => 'fulltext',
  42. 'list' => true,
  43. ),
  44. 'province_id' => array
  45. (
  46. 'type' => 'int-11',
  47. 'name' => '省份',
  48. 'default' => '0',
  49. 'desc' => '省份',
  50. 'match' => 'is_numeric',
  51. 'update' => 'select',
  52. 'option' => $province,
  53. 'list' => true,
  54. ),
  55. 'reorder' => array
  56. (
  57. 'type' => 'int-11',
  58. 'name' => '排序(数值越大越靠前)',
  59. 'default' => '1',
  60. 'desc' => '请输入排序',
  61. 'match' => 'option',
  62. 'update' => 'text',
  63. 'search' => 'order',
  64. 'list_name' => '排序',
  65. 'list' => true,
  66. 'order' => 'desc',
  67. 'edit' => true,
  68. ),
  69. 'state' => array
  70. (
  71. 'type' => 'tinyint-1',
  72. 'name' => '状态',
  73. 'default' => '1',
  74. 'desc' => '请选择状态',
  75. 'match' => 'is_numeric',
  76. ),
  77. 'cdate' => array
  78. (
  79. 'type' => 'int-11',
  80. 'name' => '录入时间',
  81. 'match' => array('is_numeric', time()),
  82. 'desc' => '',
  83. # 只有insert时才生效
  84. 'insert' => true,
  85. 'search' => 'date',
  86. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  87. ),
  88. ),
  89. 'manage' => array
  90. (
  91. ),
  92. 'request' => array
  93. (
  94. 'getAll' => array
  95. (
  96. # 匹配的正则或函数 选填项
  97. 'option' => array
  98. (
  99. 'province_id' => 'yes',
  100. 'state' => 1,
  101. ),
  102. 'type' => 'all',
  103. 'order' => array('reorder' => 'desc', 'id' => 'asc'),
  104. 'col' => 'id as value, name',
  105. ),
  106. )
  107. );