address.php 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  1. <?php
  2. $type = array
  3. (
  4. 1 => '普通地址',
  5. 2 => '默认地址',
  6. );
  7. $tag = array
  8. (
  9. 1 => '公司',
  10. 2 => '家',
  11. 3 => '学校',
  12. 4 => '其他',
  13. );
  14. return array
  15. (
  16. # 表名
  17. 'name' => 'address',
  18. # 显示给用户看的名称
  19. 'lang' => '用户地址库',
  20. 'end' => array
  21. (
  22. 'insert' => 'user/lib/address.manage_update',
  23. 'update' => 'user/lib/address.manage_update',
  24. ),
  25. 'menu' => false,
  26. # 数据结构
  27. 'struct' => array
  28. (
  29. 'id' => array
  30. (
  31. 'type' => 'int-11',
  32. 'name' => 'ID',
  33. 'default' => '',
  34. 'desc' => '',
  35. 'match' => 'is_numeric',
  36. 'search' => 'order',
  37. 'update' => 'hidden',
  38. //'list' => true,
  39. ),
  40. 'uid' => array
  41. (
  42. 'type' => 'int-11',
  43. 'name' => '用户名',
  44. 'default' => '0',
  45. 'desc' => '请选择用户',
  46. 'match' => 'is_numeric',
  47. 'update' => 'hidden',
  48. 'search' => array
  49. (
  50. 'api' => 'user/info-like',
  51. 'col' => 'search',
  52. 'result' => 'id',
  53. ),
  54. 'value' => Dever::input('search_option_uid'),
  55. 'list' => 'Dever::load("user/lib/info.get#name", {uid})',
  56. ),
  57. 'type' => array
  58. (
  59. 'type' => 'tinyint-1',
  60. 'name' => '类型',
  61. 'default' => '2',
  62. 'desc' => '类型',
  63. 'match' => 'is_numeric',
  64. 'option' => $type,
  65. 'update' => 'radio',
  66. 'list' => true,
  67. 'order' => 'desc',
  68. ),
  69. 'truename' => array
  70. (
  71. 'type' => 'varchar-100',
  72. 'name' => '联系人',
  73. 'default' => '',
  74. 'desc' => '联系人',
  75. 'match' => 'option',
  76. 'search' => 'fulltext',
  77. 'update' => 'text',
  78. 'list' => true,
  79. ),
  80. 'tel' => array
  81. (
  82. 'type' => 'varchar-100',
  83. 'name' => '联系电话',
  84. 'default' => '',
  85. 'desc' => '联系电话',
  86. 'match' => 'option',
  87. 'search' => 'fulltext',
  88. 'update' => 'text',
  89. 'list' => true,
  90. ),
  91. 'province' => array
  92. (
  93. 'type' => 'int-11',
  94. 'name' => '省份',
  95. 'default' => '',
  96. 'desc' => '省份',
  97. 'match' => 'option',
  98. //'update' => 'text',
  99. ),
  100. 'city' => array
  101. (
  102. 'type' => 'int-11',
  103. 'name' => '城市',
  104. 'default' => '',
  105. 'desc' => '城市',
  106. 'match' => 'option',
  107. //'update' => 'text',
  108. ),
  109. 'county' => array
  110. (
  111. 'type' => 'int-11',
  112. 'name' => '县区',
  113. 'default' => '',
  114. 'desc' => '县区',
  115. 'match' => 'option',
  116. //'update' => 'text',
  117. ),
  118. 'town' => array
  119. (
  120. 'type' => 'int-11',
  121. 'name' => '街道',
  122. 'default' => '',
  123. 'desc' => '街道',
  124. 'match' => 'option',
  125. //'update' => 'text',
  126. ),
  127. 'area' => array
  128. (
  129. 'type' => 'varchar-800',
  130. 'name' => '城市地区',
  131. 'default' => '',
  132. 'desc' => '城市地区',
  133. 'match' => 'is_string',
  134. 'search' => 'linkage',
  135. 'update' => 'linkage',
  136. 'option' => Dever::url('api.get?level_total=3', 'area'),
  137. 'list' => 'Dever::load("area/api.string", "{area}")',
  138. ),
  139. 'address' => array
  140. (
  141. 'type' => 'varchar-1000',
  142. 'name' => '详细地址',
  143. 'default' => '',
  144. 'desc' => '详细地址',
  145. 'match' => 'option',
  146. 'update' => 'textarea',
  147. 'list' => true,
  148. ),
  149. 'tag' => array
  150. (
  151. 'type' => 'tinyint-1',
  152. 'name' => '标签',
  153. 'default' => '1',
  154. 'desc' => '标签',
  155. 'match' => 'is_numeric',
  156. 'option' => $tag,
  157. 'update' => 'radio',
  158. 'list' => true,
  159. ),
  160. 'state' => array
  161. (
  162. 'type' => 'tinyint-1',
  163. 'name' => '状态',
  164. 'default' => '1',
  165. 'desc' => '请选择状态',
  166. 'match' => 'is_numeric',
  167. ),
  168. 'cdate' => array
  169. (
  170. 'type' => 'int-11',
  171. 'name' => '操作时间',
  172. 'match' => array('is_numeric', time()),
  173. 'desc' => '',
  174. # 只有insert时才生效
  175. //'insert' => true,
  176. 'search' => 'date',
  177. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  178. ),
  179. ),
  180. 'manage' => array
  181. (
  182. ),
  183. 'request' => array
  184. (
  185. 'getList' => array
  186. (
  187. # 匹配的正则或函数 选填项
  188. 'option' => array
  189. (
  190. 'uid' => 'yes',
  191. 'state' => 1,
  192. ),
  193. 'type' => 'all',
  194. 'order' => array('type' => 'desc','id' => 'desc'),
  195. 'page' => array(10, 'list'),
  196. 'col' => '*',
  197. ),
  198. 'updateType' => array
  199. (
  200. 'set' => array
  201. (
  202. 'type' => 'yes',
  203. ),
  204. 'where' => array
  205. (
  206. 'type' => 'yes',
  207. ),
  208. 'type' => 'update',
  209. ),
  210. ),
  211. );