address.php 5.6 KB

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