account.php 17 KB

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