member.php 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475
  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. 'auto' => 1000000,
  50. 'config_type' => $type,
  51. 'config_status' => $status,
  52. # 数据结构
  53. 'struct' => array
  54. (
  55. 'id' => array
  56. (
  57. 'type' => 'int-11',
  58. 'name' => 'ID',
  59. 'default' => '',
  60. 'desc' => '',
  61. 'match' => 'is_numeric',
  62. 'search' => 'order',
  63. //'list' => true,
  64. ),
  65. 'name' => array
  66. (
  67. 'type' => 'varchar-100',
  68. 'name' => '姓名',
  69. 'default' => '',
  70. 'desc' => '姓名',
  71. 'match' => 'is_string',
  72. 'update' => 'text',
  73. 'search' => 'fulltext',
  74. 'list' => true,
  75. ),
  76. 'rdate' => array
  77. (
  78. 'type' => 'int-11',
  79. 'name' => '认证时间',
  80. 'match' => 'option',
  81. 'default' => '0',
  82. 'desc' => '',
  83. 'update' => 'date',
  84. 'callback' => 'maketime',
  85. 'list' => '{rdate} > 0 ? date("Y-m-d H:i", {rdate}) : "无"',
  86. ),
  87. 'avatar' => array
  88. (
  89. 'type' => 'varchar-150',
  90. 'name' => '头像',
  91. 'default' => '',
  92. 'desc' => '请选择头像',
  93. 'match' => 'option',
  94. 'update' => 'image',
  95. 'key' => '1',
  96. 'place' => '150',
  97. ),
  98. 'mobile' => array
  99. (
  100. 'type' => 'bigint-11',
  101. 'name' => '手机号',
  102. 'default' => '',
  103. 'desc' => '请输入手机号',
  104. 'match' => Dever::rule('mobile'),
  105. 'update' => 'text',
  106. 'search' => 'fulltext',
  107. 'list' => true,
  108. ),
  109. 'email' => array
  110. (
  111. 'type' => 'varchar-150',
  112. 'name' => '邮箱',
  113. 'default' => '',
  114. 'desc' => '请输入邮箱',
  115. 'match' => 'option',
  116. 'update' => 'text',
  117. ),
  118. 'username' => array
  119. (
  120. 'type' => 'varchar-100',
  121. 'name' => '昵称',
  122. 'default' => '',
  123. 'desc' => '昵称',
  124. 'match' => 'is_string',
  125. 'update' => 'text',
  126. ),
  127. 'birthday' => array
  128. (
  129. 'type' => 'int-11',
  130. 'name' => '生日',
  131. 'default' => '',
  132. 'match' => 'option',
  133. 'desc' => '生日',
  134. 'update' => 'time',
  135. 'callback' => 'maketime',
  136. ),
  137. 'password' => array
  138. (
  139. 'type' => 'varchar-50',
  140. 'name' => '密码',
  141. 'default' => '',
  142. 'desc' => '请输入密码',
  143. 'match' => 'option',
  144. 'update' => 'password',
  145. 'callback' => 'sha1',
  146. ),
  147. 'parent_mid' => array
  148. (
  149. 'type' => 'int-11',
  150. 'name' => '邀请人',
  151. 'default' => '-1',
  152. 'desc' => '邀请人',
  153. 'match' => 'is_string',
  154. 'update' => 'text',
  155. 'search' => array
  156. (
  157. 'api' => 'agent/member-select',
  158. 'col' => 'name',
  159. 'result' => 'id',
  160. ),
  161. 'list' => 'Dever::load("agent/member-find#name", {parent_mid})',
  162. ),
  163. 'code' => array
  164. (
  165. 'type' => 'varchar-50',
  166. 'name' => '邀请码',
  167. 'default' => '',
  168. 'desc' => '邀请码',
  169. 'match' => 'option',
  170. //'update' => 'text',
  171. 'list' => 'Dever::load("invite/api.code", {id})',
  172. ),
  173. 'role' => array
  174. (
  175. 'type' => 'int-11',
  176. 'name' => '代理角色',
  177. 'default' => '',
  178. 'desc' => '代理角色',
  179. 'match' => 'is_numeric',
  180. 'search' => 'select',
  181. 'update' => 'select',
  182. 'option' => $role,
  183. 'list' => true,
  184. ),
  185. 'level_id' => array
  186. (
  187. 'type' => 'int-11',
  188. 'name' => '代理商等级',
  189. 'default' => '-1',
  190. 'desc' => '代理商等级',
  191. 'match' => 'is_numeric',
  192. 'search' => 'select',
  193. 'update' => 'select',
  194. 'option' => $level,
  195. 'list' => true,
  196. ),
  197. 'area' => array
  198. (
  199. 'type' => 'varchar-500',
  200. 'name' => '区域',
  201. 'default' => '',
  202. 'desc' => '区域',
  203. 'match' => 'option',
  204. 'search' => 'linkage',
  205. 'update' => 'linkage',
  206. 'option' => Dever::url('api.get?level_total=4', 'area'),
  207. 'list' => 'Dever::load("area/api.string", "{area}")',
  208. ),
  209. 'shop_id' => array
  210. (
  211. 'type' => 'int-11',
  212. 'name' => '所属门店',
  213. 'default' => '',
  214. 'desc' => '所属门店',
  215. 'match' => 'is_numeric',
  216. 'update' => 'select',
  217. 'update_search' => 'shop/lib/manage.search',
  218. 'list' => '{shop_id} > 0 ? Dever::load("shop/info-one#name", {shop_id}) : "无"',
  219. ),
  220. 'type' => array
  221. (
  222. 'type' => 'tinyint-1',
  223. 'name' => '类型',
  224. 'default' => '1',
  225. 'desc' => '类型',
  226. 'match' => 'is_numeric',
  227. 'option' => $type,
  228. 'update' => 'radio',
  229. 'control' => 'type',
  230. ),
  231. 'sign' => array
  232. (
  233. 'type' => 'varchar-150',
  234. 'name' => '手写签名',
  235. 'default' => '',
  236. 'desc' => '手写签名',
  237. 'match' => 'option',
  238. 'update' => 'image',
  239. 'key' => '7',
  240. ),
  241. 'idcard' => array
  242. (
  243. 'type' => 'varchar-32',
  244. 'name' => '身份证号码',
  245. 'default' => '',
  246. 'desc' => '身份证号码',
  247. 'match' => 'is_string',
  248. 'update' => 'text',
  249. ),
  250. 'idcard_front' => array
  251. (
  252. 'type' => 'varchar-150',
  253. 'name' => '身份证正面',
  254. 'default' => '',
  255. 'desc' => '身份证正面',
  256. 'match' => 'option',
  257. 'update' => 'image',
  258. 'key' => '8',
  259. 'place' => '660*660',
  260. ),
  261. 'idcard_back' => array
  262. (
  263. 'type' => 'varchar-150',
  264. 'name' => '身份证背面',
  265. 'default' => '',
  266. 'desc' => '身份证背面',
  267. 'match' => 'option',
  268. 'update' => 'image',
  269. 'key' => '8',
  270. 'place' => '660*660',
  271. ),
  272. 'company_name' => array
  273. (
  274. 'type' => 'varchar-100',
  275. 'name' => '公司名称',
  276. 'default' => '',
  277. 'desc' => '公司名称',
  278. 'match' => 'is_string',
  279. 'update' => 'text',
  280. //'search' => 'fulltext',
  281. //'list' => true,
  282. 'show' => 'type=2',
  283. ),
  284. 'company_pic' => array
  285. (
  286. 'type' => 'varchar-150',
  287. 'name' => '营业执照',
  288. 'default' => '',
  289. 'desc' => '营业执照',
  290. 'match' => 'option',
  291. 'update' => 'image',
  292. 'key' => '8',
  293. 'place' => '660*660',
  294. 'show' => 'type=2',
  295. ),
  296. 'company_number' => array
  297. (
  298. 'type' => 'varchar-80',
  299. 'name' => '营业执照号码',
  300. 'default' => '',
  301. 'desc' => '营业执照号码',
  302. 'match' => 'is_string',
  303. 'update' => 'text',
  304. 'show' => 'type=2',
  305. ),
  306. 'cash' => array
  307. (
  308. 'type' => 'float-11',
  309. 'name' => '余额',
  310. 'default' => '0',
  311. 'desc' => '余额',
  312. 'match' => 'is_numeric',
  313. 'update' => 'text',
  314. ),
  315. 'sell' => array
  316. (
  317. 'type' => 'float-11',
  318. 'name' => '销售业绩-直推业绩',
  319. 'default' => '0',
  320. 'desc' => '销售业绩',
  321. 'match' => 'is_numeric',
  322. 'update' => 'text',
  323. ),
  324. 'group_sell' => array
  325. (
  326. 'type' => 'float-11',
  327. 'name' => '团队销售业绩',
  328. 'default' => '0',
  329. 'desc' => '团队销售业绩',
  330. 'match' => 'is_numeric',
  331. 'update' => 'text',
  332. ),
  333. 'status' => array
  334. (
  335. 'type' => 'tinyint-1',
  336. 'name' => '状态',
  337. 'default' => '1',
  338. 'desc' => '状态',
  339. 'match' => 'is_numeric',
  340. 'option' => $status,
  341. 'search' => 'select',
  342. 'list' => true,
  343. ),
  344. 'state' => array
  345. (
  346. 'type' => 'tinyint-1',
  347. 'name' => '状态',
  348. 'default' => '1',
  349. 'desc' => '请选择状态',
  350. 'match' => 'is_numeric',
  351. ),
  352. 'cdate' => array
  353. (
  354. 'type' => 'int-11',
  355. 'name' => '创建时间',
  356. 'match' => array('is_numeric', time()),
  357. 'desc' => '',
  358. # 只有insert时才生效
  359. //'insert' => true,
  360. 'search' => 'date',
  361. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  362. ),
  363. ),
  364. 'manage' => array
  365. (
  366. 'insert' => false,
  367. 'delete' => false,
  368. 'edit' => false,
  369. 'list_button' => array
  370. (
  371. 'list' => array('查看详情', '"member_area&mid={id}&page_type=1"'),
  372. //'edit' => array('退款', 'status,tk_time,tk_pic,tk_desc,tk_admin,tk_status', '{status} == 6'),
  373. //'delete' => array('删除', '', '{status} == 1'),
  374. ),
  375. ),
  376. 'request' => array
  377. (
  378. 'getInfo' => array
  379. (
  380. # 匹配的正则或函数 选填项
  381. 'option' => array
  382. (
  383. 'status' => 2,
  384. 'state' => 1,
  385. ),
  386. 'order' => array('id' => 'desc'),
  387. 'type' => 'one',
  388. 'col' => '*',
  389. ),
  390. 'getData' => array
  391. (
  392. # 匹配的正则或函数 选填项
  393. 'option' => array
  394. (
  395. 'idcard' => 'yes',
  396. 'id' => array('yes', '!='),
  397. 'status' => 2,
  398. 'state' => 1,
  399. ),
  400. 'order' => array('id' => 'desc'),
  401. 'type' => 'all',
  402. 'page' => array(20, 'list'),
  403. 'col' => '*',
  404. ),
  405. 'upSell' => array
  406. (
  407. 'type' => 'update',
  408. 'where' => array
  409. (
  410. 'id' => 'yes',
  411. ),
  412. 'set' => array
  413. (
  414. 'cash' => array('yes', '+='),
  415. 'upcol' => array('yes-sell', '+='),
  416. 'level_id' => 'yes',
  417. ),
  418. ),
  419. 'upGroupSell' => array
  420. (
  421. 'type' => 'update',
  422. 'where' => array
  423. (
  424. 'id' => 'yes',
  425. ),
  426. 'set' => array
  427. (
  428. 'cash' => array('yes', '+='),
  429. 'upcol' => array('yes-group_sell', '+='),
  430. 'level_id' => 'yes',
  431. ),
  432. ),
  433. ),
  434. );