account.php 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519
  1. <?php
  2. $status = array
  3. (
  4. 1 => '未激活',
  5. 2 => '正常',
  6. 3 => '停用',
  7. );
  8. $audit_manage = array
  9. (
  10. //1 => '未开始审核',
  11. //2 => '待审核',
  12. 3 => '审核通过',
  13. 4 => '审核未通过',
  14. );
  15. $audit_search = array
  16. (
  17. //1 => '未开始审核',
  18. 2 => '待审核',
  19. 3 => '审核通过',
  20. 4 => '审核未通过',
  21. );
  22. $audit = array
  23. (
  24. 1 => '未开始审核',
  25. 2 => '待审核',
  26. 3 => '审核通过',
  27. 4 => '审核未通过',
  28. );
  29. $is_email = array
  30. (
  31. 1 => '邮箱已验证',
  32. 2 => '邮箱未验证',
  33. );
  34. $send_email = array
  35. (
  36. 1 => '不发送邮件',
  37. 2 => '发送邮件',
  38. );
  39. $is_idcard = array
  40. (
  41. 1 => '已上传',
  42. 2 => '未上传',
  43. );
  44. $agreement_status = array
  45. (
  46. 0 => '合同审核状态',
  47. 1 => '待签署',
  48. 2 => '有效',
  49. 3 => '作废',
  50. );
  51. $col = Dever::input('col');
  52. # 权限设置 1是审核列表、2是账户列表、3是展示列表
  53. $search_auth = Dever::input('search_option_dever_auth', 1);
  54. $button = $list_button = array();
  55. if ($search_auth <= 2) {
  56. $list_button = array
  57. (
  58. 'list' => array('查看详情', '"cash&mid={mid}&page_type=1&search_auth='.$search_auth.'"'),
  59. );
  60. }
  61. if ($search_auth == 1) {
  62. $list_button['edit'] = array('审核', 'audit,audit_desc', '{audit} == 2');
  63. } elseif ($search_auth == 2) {
  64. $button = array
  65. (
  66. '创建账户' => array('fast', '', 'member'),
  67. );
  68. $list_button['list1'] = array('账户列表', '"member&search_option_aid={id}&search_option_dever_auth='.$search_auth.'"');
  69. } elseif ($search_auth == 3) {
  70. $list_button['list1'] = array('账户列表', '"member&search_option_aid={id}&search_option_dever_auth='.$search_auth.'"');
  71. }
  72. return array
  73. (
  74. # 表名
  75. 'name' => 'account',
  76. # 显示给用户看的名称
  77. 'lang' => '期权登录账户',
  78. 'order' => 100,
  79. 'set' => array
  80. (
  81. 'status' => $status,
  82. 'audit' => $audit,
  83. 'is_email' => $is_email,
  84. 'is_idcard' => $is_idcard,
  85. ),
  86. 'end' => array
  87. (
  88. 'update' => 'option/lib/manage.updateAccount',
  89. ),
  90. 'check' => 'mid',
  91. # 数据结构
  92. 'struct' => array
  93. (
  94. 'id' => array
  95. (
  96. 'type' => 'int-11',
  97. 'name' => 'ID',
  98. 'default' => '',
  99. 'desc' => '',
  100. 'match' => 'is_numeric',
  101. 'search' => 'order',
  102. //'list' => true,
  103. ),
  104. 'mid' => array
  105. (
  106. 'type' => 'int-11',
  107. 'name' => '姓名',
  108. 'default' => '',
  109. 'desc' => '期权账户',
  110. 'match' => 'is_numeric',
  111. 'update' => 'text',
  112. 'search' => array
  113. (
  114. 'api' => 'option/member-getOne',
  115. 'col' => 'name',
  116. 'result' => 'id',
  117. 'search' => 'mid',//本表的字段,默认为当前的字段
  118. ),
  119. 'list_name' => '期权账户',
  120. 'list' => 'Dever::load("option/lib/member.getInfo", {mid})',
  121. 'list_order' => 1,
  122. ),
  123. 'option-member-mobile'=> array
  124. (
  125. 'name' => '手机号',
  126. 'default' => '',
  127. 'desc' => '手机号',
  128. 'match' => 'option',
  129. 'search' => array
  130. (
  131. 'api' => 'option/member-getOne',
  132. 'col' => 'mobile',
  133. 'result' => 'id',
  134. 'search' => 'mid',
  135. ),
  136. # 读取另外表的关联方式
  137. 'sync' => array('mid', 'id'),
  138. ),
  139. 'option-member-key'=> array
  140. (
  141. 'name' => '索引号',
  142. 'default' => '',
  143. 'desc' => '索引号',
  144. 'match' => 'option',
  145. 'search' => array
  146. (
  147. 'api' => 'option/member-getOne',
  148. 'col' => 'key',
  149. 'result' => 'id',
  150. 'search' => 'mid',
  151. ),
  152. # 读取另外表的关联方式
  153. 'sync' => array('mid', 'id'),
  154. ),
  155. 'is_email' => array
  156. (
  157. 'type' => 'tinyint-1',
  158. 'name' => '邮箱认证',
  159. 'default' => '2',
  160. 'desc' => '邮箱是否验证',
  161. 'match' => 'is_numeric',
  162. 'search' => 'select',
  163. 'option' => $is_email,
  164. 'list' => 'Dever::load("option/lib/account.getEmail", {id})',
  165. 'list_order' => 3,
  166. ),
  167. 'send_email' => array
  168. (
  169. 'type' => 'tinyint-1',
  170. 'name' => '是否发送邮件',
  171. 'default' => '2',
  172. 'desc' => '是否发送邮件',
  173. 'match' => 'is_numeric',
  174. 'update' => 'radio',
  175. 'option' => $send_email,
  176. ),
  177. 'email' => array
  178. (
  179. 'type' => 'varchar-150',
  180. 'name' => '邮箱',
  181. 'default' => '',
  182. 'desc' => '请输入邮箱',
  183. 'search' => 'fulltext',
  184. 'match' => 'option||' . Dever::rule('email'),
  185. 'update' => 'text',
  186. ),
  187. 'is_idcard' => array
  188. (
  189. 'type' => 'tinyint-1',
  190. 'name' => '身份证资料',
  191. 'default' => '2',
  192. 'desc' => '身份证资料',
  193. 'match' => 'is_numeric',
  194. 'option' => $is_idcard,
  195. 'search' => 'select',
  196. //'update' => 'radio',
  197. 'list' => $search_auth == 1 ? 'Dever::load("option/lib/account.getIdcard", {id})' : false,
  198. 'list_order' => 3,
  199. 'list_header' => array('width' => '30%'),
  200. ),
  201. 'option-member-idcard'=> array
  202. (
  203. 'name' => '身份证号码',
  204. 'default' => '',
  205. 'desc' => '身份证号码',
  206. 'match' => 'option',
  207. 'search' => array
  208. (
  209. 'api' => 'option/member-getOne',
  210. 'col' => 'idcard',
  211. 'result' => 'id',
  212. 'search' => 'mid',
  213. ),
  214. # 读取另外表的关联方式
  215. 'sync' => array('mid', 'id'),
  216. 'list' => $search_auth == 2 ? 'Dever::load("option/lib/account.getCash#daijiaofu", {id})' : false,
  217. 'list_name' => '待交付',
  218. 'list_order' => 4,
  219. ),
  220. 'idcard_front' => array
  221. (
  222. 'type' => 'varchar-150',
  223. 'name' => '身份证正面',
  224. 'default' => '',
  225. 'desc' => '身份证正面',
  226. 'match' => 'option',
  227. 'update' => $col ? 'image' : false,
  228. 'key' => '8',
  229. //'place' => '660*660',
  230. 'list' => $search_auth == 2 ? 'Dever::load("option/lib/account.getCash#qiquan", {id})' : false,
  231. 'list_name' => '期权',
  232. 'list_order' => 5,
  233. ),
  234. 'idcard_back' => array
  235. (
  236. 'type' => 'varchar-150',
  237. 'name' => '身份证背面',
  238. 'default' => '',
  239. 'desc' => '身份证背面',
  240. 'match' => 'option',
  241. 'update' => $col ? 'image' : false,
  242. 'key' => '8',
  243. //'place' => '660*660',
  244. 'list' => $search_auth == 2 ? 'Dever::load("option/lib/account.getCash#yuanshiqiquan", {id})' : false,
  245. 'list_name' => '原始期权',
  246. 'list_order' => 6,
  247. ),
  248. 'audit' => array
  249. (
  250. 'type' => 'tinyint-1',
  251. 'name' => $search_auth == 1 ? '审核状况' : '账户认证',
  252. 'default' => $col ? '3' : '1',
  253. 'desc' => '审核状况',
  254. 'match' => 'is_numeric',
  255. 'option' => $col ? $audit_manage : $audit_search,
  256. 'search' => 'select',
  257. 'update' => $col ? 'radio' : false,
  258. 'list' => 'Dever::load("option/lib/account.getAudit", {id})',
  259. 'list_order' => $search_auth == 1 ? 5 : 3,
  260. 'value' => $col ? '3' : '1',
  261. 'control' => 'audit',
  262. ),
  263. 'audit_desc' => array
  264. (
  265. 'type' => 'varchar-500',
  266. 'name' => '审核备注',
  267. 'default' => '',
  268. 'desc' => '审核备注',
  269. 'match' => 'option',
  270. 'update' => $col ? 'textarea' : false,
  271. 'show' => 'audit=4',
  272. ),
  273. 'audit_date' => array
  274. (
  275. 'type' => 'int-11',
  276. 'name' => '审核时间',
  277. 'default' => '',
  278. 'match' => 'is_numeric',
  279. 'desc' => '审核时间',
  280. ),
  281. 'option-agreement-status'=> array
  282. (
  283. 'name' => '名称',
  284. 'default' => '',
  285. 'desc' => '手机号',
  286. 'match' => 'option',
  287. 'search' => $search_auth == 3 ? array
  288. (
  289. 'api' => 'option/agreement-select',
  290. 'col' => 'status',
  291. 'result' => 'aid',
  292. 'search' => 'id',
  293. 'option' => $agreement_status,
  294. ) : 'hidden',
  295. # 读取另外表的关联方式
  296. 'sync' => array('id', 'aid'),
  297. 'list_name' => '合同审核状态',
  298. 'list' => $search_auth == 3 ? 'Dever::load("option/lib/account.getAgreementStatus", {id})' : false,
  299. 'list_order' => 10,
  300. ),
  301. 'status' => array
  302. (
  303. 'type' => 'tinyint-1',
  304. 'name' => '状态',
  305. 'default' => '1',
  306. 'desc' => '状态',
  307. 'match' => 'is_numeric',
  308. 'option' => $status,
  309. //'search' => 'select',
  310. 'list' => $search_auth == 1 ? false : true,
  311. 'list_order' => 100,
  312. ),
  313. 'stype' => array
  314. (
  315. 'type' => 'int-11',
  316. 'name' => '类型-仅用于展示类型',
  317. 'default' => '-1',
  318. 'desc' => '类型',
  319. 'match' => 'is_string',
  320. 'update' => 'text',
  321. 'search' => 'hidden',
  322. ),
  323. 'dever_auth' => array
  324. (
  325. 'name' => '权限',
  326. 'default' => '',
  327. 'desc' => '类型',
  328. 'match' => 'is_string',
  329. 'search' => 'hidden',
  330. ),
  331. 'state' => array
  332. (
  333. 'type' => 'tinyint-1',
  334. 'name' => '状态',
  335. 'default' => '1',
  336. 'desc' => '请选择状态',
  337. 'match' => 'is_numeric',
  338. ),
  339. 'cdate' => array
  340. (
  341. 'type' => 'int-11',
  342. 'name' => '创建时间',
  343. 'match' => array('is_numeric', time()),
  344. 'desc' => '',
  345. # 只有insert时才生效
  346. 'insert' => true,
  347. 'search' => 'date',
  348. 'list' => 'date("Y-m-d H:i", {cdate})',
  349. 'list_order' => 2,
  350. ),
  351. ),
  352. 'manage' => array
  353. (
  354. 'insert' => false,
  355. 'delete' => false,
  356. 'edit' => false,
  357. 'button' => $button,
  358. 'list_button' => $list_button,
  359. ),
  360. 'request' => array
  361. (
  362. 'list' => array
  363. (
  364. # 匹配的正则或函数 选填项
  365. 'option' => array
  366. (
  367. 'mid' => 'yes',
  368. 'is_email' => 'yes',
  369. 'is_idcard' => 'yes',
  370. 'email' => array('yes', 'like'),
  371. 'audit' => array('yes', 'in'),
  372. 'start_cdate' => array('yes-cdate', '>='),
  373. 'end_cdate' => array('yes-cdate', '<='),
  374. 'state' => 1,
  375. ),
  376. 'type' => 'all',
  377. 'order' => array('id' => 'desc'),
  378. 'page' => array(20, 'list'),
  379. 'col' => '*',
  380. ),
  381. 'getInfo' => array
  382. (
  383. # 匹配的正则或函数 选填项
  384. 'option' => array
  385. (
  386. 'status' => 2,
  387. 'state' => 1,
  388. ),
  389. 'order' => array('id' => 'desc'),
  390. 'type' => 'one',
  391. 'col' => '*',
  392. ),
  393. 'getData' => array
  394. (
  395. # 匹配的正则或函数 选填项
  396. 'option' => array
  397. (
  398. 'idcard' => 'yes',
  399. 'id' => array('yes', '!='),
  400. 'status' => 2,
  401. 'state' => 1,
  402. ),
  403. 'order' => array('id' => 'desc'),
  404. 'type' => 'all',
  405. 'page' => array(20, 'list'),
  406. 'col' => '*',
  407. ),
  408. 'upCash' => array
  409. (
  410. 'type' => 'update',
  411. 'where' => array
  412. (
  413. 'id' => 'yes',
  414. ),
  415. 'set' => array
  416. (
  417. 'cash' => array('yes', '+='),
  418. ),
  419. ),
  420. 'upSell' => array
  421. (
  422. 'type' => 'update',
  423. 'where' => array
  424. (
  425. 'id' => 'yes',
  426. ),
  427. 'set' => array
  428. (
  429. 'cash' => array('yes', '+='),
  430. 'upcol' => array('yes-sell', '+='),
  431. 'level_id' => 'yes',
  432. ),
  433. ),
  434. 'upGroupSell' => array
  435. (
  436. 'type' => 'update',
  437. 'where' => array
  438. (
  439. 'id' => 'yes',
  440. ),
  441. 'set' => array
  442. (
  443. 'cash' => array('yes', '+='),
  444. 'upcol' => array('yes-group_sell', '+='),
  445. 'level_id' => 'yes',
  446. ),
  447. ),
  448. 'upGroupSellOne' => array
  449. (
  450. 'type' => 'update',
  451. 'where' => array
  452. (
  453. 'id' => 'yes',
  454. ),
  455. 'set' => array
  456. (
  457. 'group_sell' => array('yes', '+='),
  458. ),
  459. ),
  460. # 获取订单数量
  461. 'getNum' => array
  462. (
  463. # 匹配的正则或函数 选填项
  464. 'option' => array
  465. (
  466. 'start' => array('yes-cdate', '>='),
  467. 'end' => array('yes-cdate', '<='),
  468. 'status' => 'yes',
  469. 'role' => 'yes',
  470. 'state' => 1,
  471. ),
  472. 'type' => 'count',
  473. 'col' => '*',
  474. ),
  475. ),
  476. );