address.php 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. <?php
  2. $type = array
  3. (
  4. 1 => '普通地址',
  5. 2 => '默认地址',
  6. );
  7. return array
  8. (
  9. # 表名
  10. 'name' => 'address',
  11. # 显示给用户看的名称
  12. 'lang' => '用户地址库',
  13. 'menu' => false,
  14. # 数据结构
  15. 'struct' => array
  16. (
  17. 'id' => array
  18. (
  19. 'type' => 'int-11',
  20. 'name' => 'ID',
  21. 'default' => '',
  22. 'desc' => '',
  23. 'match' => 'is_numeric',
  24. 'search' => 'order',
  25. 'update' => 'hidden',
  26. //'list' => true,
  27. ),
  28. 'uid' => array
  29. (
  30. 'type' => 'int-11',
  31. 'name' => '用户名',
  32. 'default' => '0',
  33. 'desc' => '请选择用户',
  34. 'match' => 'is_numeric',
  35. 'update' => 'text',
  36. //'search' => 'select',
  37. 'search' => array
  38. (
  39. 'api' => 'passport/user-all',
  40. 'col' => 'username',
  41. 'result' => 'id',
  42. ),
  43. 'list' => '{uid} > 0 ? Dever::load("passport/user-one#username", {uid}) : "匿名用户"',
  44. ),
  45. 'type' => array
  46. (
  47. 'type' => 'tinyint-1',
  48. 'name' => '类型',
  49. 'default' => '1',
  50. 'desc' => '类型',
  51. 'match' => 'is_numeric',
  52. 'option' => $type,
  53. 'update' => 'select',
  54. //'list' => true,
  55. ),
  56. 'country' => array
  57. (
  58. 'type' => 'varchar-100',
  59. 'name' => '国家',
  60. 'default' => '',
  61. 'desc' => '国家',
  62. 'match' => 'option',
  63. //'update' => 'text',
  64. ),
  65. 'province' => array
  66. (
  67. 'type' => 'varchar-100',
  68. 'name' => '省份',
  69. 'default' => '',
  70. 'desc' => '省份',
  71. 'match' => 'option',
  72. //'update' => 'text',
  73. ),
  74. 'city' => array
  75. (
  76. 'type' => 'varchar-100',
  77. 'name' => '城市',
  78. 'default' => '',
  79. 'desc' => '城市',
  80. 'match' => 'option',
  81. //'update' => 'text',
  82. ),
  83. 'area' => array
  84. (
  85. 'type' => 'varchar-800',
  86. 'name' => '地区',
  87. 'default' => '',
  88. 'desc' => '地区',
  89. 'match' => 'option',
  90. //'update' => 'text',
  91. //'list' => true,
  92. ),
  93. 'area_id' => array
  94. (
  95. 'type' => 'varchar-800',
  96. 'name' => '地区',
  97. 'default' => '',
  98. 'desc' => '地区',
  99. 'match' => 'option',
  100. //'update' => 'text',
  101. //'list' => true,
  102. ),
  103. 'address' => array
  104. (
  105. 'type' => 'varchar-1000',
  106. 'name' => '详细地址',
  107. 'default' => '',
  108. 'desc' => '详细地址',
  109. 'match' => 'option',
  110. //'update' => 'text',
  111. //'list' => true,
  112. ),
  113. 'state' => array
  114. (
  115. 'type' => 'tinyint-1',
  116. 'name' => '状态',
  117. 'default' => '1',
  118. 'desc' => '请选择状态',
  119. 'match' => 'is_numeric',
  120. ),
  121. 'cdate' => array
  122. (
  123. 'type' => 'int-11',
  124. 'name' => '操作时间',
  125. 'match' => array('is_numeric', time()),
  126. 'desc' => '',
  127. # 只有insert时才生效
  128. //'insert' => true,
  129. 'search' => 'date',
  130. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  131. ),
  132. ),
  133. 'manage' => array
  134. (
  135. ),
  136. 'request' => array
  137. (
  138. 'getList' => array
  139. (
  140. # 匹配的正则或函数 选填项
  141. 'option' => array
  142. (
  143. 'uid' => 'yes',
  144. 'state' => 1,
  145. ),
  146. 'type' => 'all',
  147. 'order' => array('type' => 'desc','id' => 'desc'),
  148. 'page' => array(10, 'list');
  149. 'col' => '*',
  150. ),
  151. ),
  152. );