member.php 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306
  1. <?php
  2. $role = function()
  3. {
  4. $array = array();
  5. $data = Dever::load('setting/role-state');
  6. if($data)
  7. {
  8. $array += $data;
  9. }
  10. return $array;
  11. };
  12. $status = array
  13. (
  14. 1 => '申请中',
  15. 2 => '正常',
  16. 3 => '驳回',
  17. 4 => '已删除',
  18. 5 => '已禁用',
  19. );
  20. $type = array
  21. (
  22. 1 => '个人',
  23. 2 => '公司',
  24. );
  25. $level = function()
  26. {
  27. $array = array
  28. (
  29. -1 => array
  30. (
  31. 'id' => -1,
  32. 'name' => '普通',
  33. ),
  34. );
  35. $data = Dever::load('setting/level-state');
  36. if($data)
  37. {
  38. $array += $data;
  39. }
  40. return $array;
  41. };
  42. return array
  43. (
  44. # 表名
  45. 'name' => 'member',
  46. # 显示给用户看的名称
  47. 'lang' => '代理商管理',
  48. 'order' => 100,
  49. # 数据结构
  50. 'struct' => array
  51. (
  52. 'id' => array
  53. (
  54. 'type' => 'int-11',
  55. 'name' => 'ID',
  56. 'default' => '',
  57. 'desc' => '',
  58. 'match' => 'is_numeric',
  59. 'search' => 'order',
  60. //'list' => true,
  61. ),
  62. 'name' => array
  63. (
  64. 'type' => 'varchar-100',
  65. 'name' => '姓名',
  66. 'default' => '',
  67. 'desc' => '姓名',
  68. 'match' => 'is_string',
  69. 'update' => 'text',
  70. 'search' => 'fulltext',
  71. 'list' => true,
  72. ),
  73. 'rdate' => array
  74. (
  75. 'type' => 'int-11',
  76. 'name' => '认证时间',
  77. 'match' => 'option',
  78. 'default' => '0',
  79. 'desc' => '',
  80. 'update' => 'date',
  81. 'callback' => 'maketime',
  82. 'list' => '{rdate} > 0 ? date("Y-m-d H:i", {rdate}) : "无"',
  83. ),
  84. 'avatar' => array
  85. (
  86. 'type' => 'varchar-150',
  87. 'name' => '头像',
  88. 'default' => '',
  89. 'desc' => '请选择头像',
  90. 'match' => 'option',
  91. 'update' => 'image',
  92. 'key' => '1',
  93. 'place' => '150',
  94. ),
  95. 'mobile' => array
  96. (
  97. 'type' => 'bigint-11',
  98. 'name' => '手机号',
  99. 'default' => '',
  100. 'desc' => '请输入手机号',
  101. 'match' => Dever::rule('mobile'),
  102. 'update' => 'text',
  103. 'search' => 'fulltext',
  104. 'list' => true,
  105. ),
  106. 'password' => array
  107. (
  108. 'type' => 'varchar-50',
  109. 'name' => '密码',
  110. 'default' => '',
  111. 'desc' => '请输入密码',
  112. 'match' => 'option',
  113. 'update' => 'password',
  114. 'callback' => 'sha1',
  115. ),
  116. 'parent_mid' => array
  117. (
  118. 'type' => 'int-11',
  119. 'name' => '邀请人',
  120. 'default' => '-1',
  121. 'desc' => '邀请人',
  122. 'match' => 'is_string',
  123. 'update' => 'text',
  124. 'search' => array
  125. (
  126. 'api' => 'agent/member-select',
  127. 'col' => 'name',
  128. 'result' => 'id',
  129. ),
  130. 'list' => 'Dever::load("agent/member-find#name", {parent_mid})',
  131. ),
  132. 'code' => array
  133. (
  134. 'type' => 'varchar-50',
  135. 'name' => '邀请码',
  136. 'default' => '',
  137. 'desc' => '邀请码',
  138. 'match' => 'option',
  139. //'update' => 'text',
  140. 'list' => 'Dever::load("invite/api.code", {id})',
  141. ),
  142. 'role' => array
  143. (
  144. 'type' => 'int-11',
  145. 'name' => '代理角色',
  146. 'default' => '',
  147. 'desc' => '代理角色',
  148. 'match' => 'is_numeric',
  149. 'search' => 'select',
  150. 'update' => 'checkbox',
  151. 'option' => $role,
  152. 'list' => true,
  153. ),
  154. 'level_id' => array
  155. (
  156. 'type' => 'int-11',
  157. 'name' => '代理商等级',
  158. 'default' => '-1',
  159. 'desc' => '代理商等级',
  160. 'match' => 'is_numeric',
  161. 'search' => 'select',
  162. 'update' => 'select',
  163. 'option' => $level,
  164. 'list' => true,
  165. ),
  166. 'area' => array
  167. (
  168. 'type' => 'varchar-500',
  169. 'name' => '区域',
  170. 'default' => '',
  171. 'desc' => '区域',
  172. 'match' => 'option',
  173. 'search' => 'linkage',
  174. 'update' => 'linkage',
  175. 'option' => Dever::url('api.get?level_total=4', 'area'),
  176. 'list' => 'Dever::load("area/api.string", "{area}")',
  177. ),
  178. 'shop_id' => array
  179. (
  180. 'type' => 'int-11',
  181. 'name' => '所属门店',
  182. 'default' => '',
  183. 'desc' => '所属门店',
  184. 'match' => 'is_numeric',
  185. 'update' => 'text',
  186. 'list' => 'Dever::load("shop/info-one#name", {shop_id})',
  187. ),
  188. 'type' => array
  189. (
  190. 'type' => 'tinyint-1',
  191. 'name' => '类型',
  192. 'default' => '1',
  193. 'desc' => '类型',
  194. 'match' => 'is_numeric',
  195. 'option' => $type,
  196. ),
  197. 'sign' => array
  198. (
  199. 'type' => 'varchar-150',
  200. 'name' => '手写签名',
  201. 'default' => '',
  202. 'desc' => '手写签名',
  203. 'match' => 'option',
  204. 'update' => 'image',
  205. 'key' => '7',
  206. ),
  207. 'idcard' => array
  208. (
  209. 'type' => 'varchar-32',
  210. 'name' => '身份证号码',
  211. 'default' => '',
  212. 'desc' => '身份证号码',
  213. 'match' => 'is_string',
  214. 'update' => 'text',
  215. ),
  216. 'idcard_front' => array
  217. (
  218. 'type' => 'varchar-150',
  219. 'name' => '身份证正面',
  220. 'default' => '',
  221. 'desc' => '身份证正面',
  222. 'match' => 'option',
  223. 'update' => 'image',
  224. 'key' => '8',
  225. 'place' => '660*660',
  226. ),
  227. 'idcard_back' => array
  228. (
  229. 'type' => 'varchar-150',
  230. 'name' => '身份证背面',
  231. 'default' => '',
  232. 'desc' => '身份证背面',
  233. 'match' => 'option',
  234. 'update' => 'image',
  235. 'key' => '8',
  236. 'place' => '660*660',
  237. ),
  238. 'status' => array
  239. (
  240. 'type' => 'tinyint-1',
  241. 'name' => '状态',
  242. 'default' => '1',
  243. 'desc' => '状态',
  244. 'match' => 'is_numeric',
  245. 'option' => $status,
  246. 'search' => 'select',
  247. 'list' => true,
  248. ),
  249. 'state' => array
  250. (
  251. 'type' => 'tinyint-1',
  252. 'name' => '状态',
  253. 'default' => '1',
  254. 'desc' => '请选择状态',
  255. 'match' => 'is_numeric',
  256. ),
  257. 'cdate' => array
  258. (
  259. 'type' => 'int-11',
  260. 'name' => '创建时间',
  261. 'match' => array('is_numeric', time()),
  262. 'desc' => '',
  263. # 只有insert时才生效
  264. //'insert' => true,
  265. 'search' => 'date',
  266. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  267. ),
  268. ),
  269. 'manage' => array
  270. (
  271. 'insert' => false,
  272. 'delete' => false,
  273. 'edit' => false,
  274. ),
  275. 'request' => array
  276. (
  277. ),
  278. );