account.php 16 KB

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