account.php 16 KB

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