account.php 16 KB

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