account.php 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547
  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',
  197. //'update' => 'radio',
  198. 'list' => $search_auth == 1 ? 'Dever::load("option/lib/account.getIdcard", {id})' : false,
  199. 'list_order' => 3,
  200. 'list_header' => array('width' => '30%'),
  201. ),
  202. 'option-member-idcard'=> array
  203. (
  204. 'name' => '身份证号码',
  205. 'default' => '',
  206. 'desc' => '身份证号码',
  207. 'match' => 'option',
  208. 'search' => array
  209. (
  210. 'api' => 'option/member-getOne',
  211. 'col' => 'idcard',
  212. 'result' => 'id',
  213. 'search' => 'mid',
  214. ),
  215. # 读取另外表的关联方式
  216. 'sync' => array('mid', 'id'),
  217. 'list' => $search_auth == 2 ? 'Dever::load("option/lib/account.getCash#daijiaofu", {id})' : false,
  218. 'list_name' => '待交付',
  219. 'list_order' => 4,
  220. ),
  221. 'idcard_front' => array
  222. (
  223. 'type' => 'varchar-150',
  224. 'name' => '身份证正面',
  225. 'default' => '',
  226. 'desc' => '身份证正面',
  227. 'match' => 'option',
  228. 'update' => $col ? 'image' : false,
  229. 'key' => '8',
  230. //'place' => '660*660',
  231. 'list' => $search_auth == 2 ? 'Dever::load("option/lib/account.getCash#qiquan", {id})' : false,
  232. 'list_name' => '期权',
  233. 'list_order' => 5,
  234. ),
  235. 'idcard_back' => array
  236. (
  237. 'type' => 'varchar-150',
  238. 'name' => '身份证背面',
  239. 'default' => '',
  240. 'desc' => '身份证背面',
  241. 'match' => 'option',
  242. 'update' => $col ? 'image' : false,
  243. 'key' => '8',
  244. //'place' => '660*660',
  245. 'list' => $search_auth == 2 ? 'Dever::load("option/lib/account.getCash#yuanshiqiquan", {id})' : false,
  246. 'list_name' => '原始期权',
  247. 'list_order' => 6,
  248. ),
  249. 'audit' => array
  250. (
  251. 'type' => 'tinyint-1',
  252. 'name' => $search_auth == 1 ? '审核状况' : '账户认证',
  253. 'default' => $col ? '3' : '1',
  254. 'desc' => '审核状况',
  255. 'match' => 'is_numeric',
  256. 'option' => $col ? $audit_manage : $audit_search,
  257. 'search' => 'select',
  258. 'update' => $col ? 'radio' : false,
  259. 'list' => 'Dever::load("option/lib/account.getAudit", {id})',
  260. 'list_order' => $search_auth == 1 ? 5 : 3,
  261. 'value' => $col ? '3' : '1',
  262. 'control' => 'audit',
  263. ),
  264. 'audit_desc' => array
  265. (
  266. 'type' => 'varchar-500',
  267. 'name' => '审核备注',
  268. 'default' => '',
  269. 'desc' => '审核备注',
  270. 'match' => 'option',
  271. 'update' => $col ? 'textarea' : false,
  272. 'show' => 'audit=4',
  273. ),
  274. 'audit_date' => array
  275. (
  276. 'type' => 'int-11',
  277. 'name' => '审核时间',
  278. 'default' => '',
  279. 'match' => 'is_numeric',
  280. 'desc' => '审核时间',
  281. ),
  282. 'option-agreement-status'=> array
  283. (
  284. 'name' => '名称',
  285. 'default' => '',
  286. 'desc' => '手机号',
  287. 'match' => 'option',
  288. 'search' => $search_auth == 3 ? array
  289. (
  290. 'api' => 'option/agreement-select',
  291. 'col' => 'audit',
  292. 'result' => 'aid',
  293. 'search' => 'id',
  294. 'option' => $agreement_status,
  295. 'no' => '(select aid from churen_option_agreement)',
  296. ) : 'hidden',
  297. # 读取另外表的关联方式
  298. 'sync' => array('id', 'aid'),
  299. 'list_name' => '合同审核状态',
  300. 'list' => $search_auth == 3 ? 'Dever::load("option/lib/account.getAgreementStatus", {id})' : false,
  301. 'list_order' => 10,
  302. ),
  303. 'status' => array
  304. (
  305. 'type' => 'tinyint-1',
  306. 'name' => '状态',
  307. 'default' => '1',
  308. 'desc' => '状态',
  309. 'match' => 'is_numeric',
  310. 'option' => $status,
  311. 'search' => 'select',
  312. 'list' => $search_auth == 1 ? false : true,
  313. 'list_order' => 100,
  314. ),
  315. 'stype' => array
  316. (
  317. 'type' => 'int-11',
  318. 'name' => '类型-仅用于展示类型',
  319. 'default' => '-1',
  320. 'desc' => '类型',
  321. 'match' => 'is_string',
  322. 'update' => 'text',
  323. 'search' => 'hidden',
  324. ),
  325. 'dever_auth' => array
  326. (
  327. 'name' => '权限',
  328. 'default' => '',
  329. 'desc' => '类型',
  330. 'match' => 'is_string',
  331. 'search' => 'hidden',
  332. ),
  333. 'state' => array
  334. (
  335. 'type' => 'tinyint-1',
  336. 'name' => '状态',
  337. 'default' => '1',
  338. 'desc' => '请选择状态',
  339. 'match' => 'is_numeric',
  340. ),
  341. 'cdate' => array
  342. (
  343. 'type' => 'int-11',
  344. 'name' => '创建时间',
  345. 'match' => array('is_numeric', time()),
  346. 'desc' => '',
  347. # 只有insert时才生效
  348. 'insert' => true,
  349. 'search' => 'date',
  350. 'list' => 'date("Y-m-d H:i", {cdate})',
  351. 'list_order' => 2,
  352. ),
  353. ),
  354. 'manage' => array
  355. (
  356. 'insert' => false,
  357. 'delete' => false,
  358. 'edit' => false,
  359. 'button' => $button,
  360. 'list_button' => $list_button,
  361. ),
  362. 'request' => array
  363. (
  364. 'list' => array
  365. (
  366. # 匹配的正则或函数 选填项
  367. 'option' => array
  368. (
  369. 'id' => array('yes', 'in'),
  370. 'mid' => 'yes',
  371. 'is_email' => 'yes',
  372. 'is_idcard' => 'yes',
  373. 'email' => array('yes', 'like'),
  374. 'audit' => array('yes', 'in'),
  375. 'start_cdate' => array('yes-cdate', '>='),
  376. 'end_cdate' => array('yes-cdate', '<='),
  377. //'no' => 'yes-NOT EXISTS (select * from churen_option_agreement as a where a.aid = churen_option_account.id)',
  378. /*
  379. 'not' => array
  380. (
  381. 'table' => 'option/agreement',
  382. 'on' => array('aid','id'),
  383. ),
  384. */
  385. 'no' => array('yes-id', 'not in'),
  386. 'status' => 'yes',
  387. 'state' => 1,
  388. ),
  389. 'type' => 'all',
  390. 'order' => array('id' => 'desc'),
  391. 'page' => array(20, 'list'),
  392. 'col' => '*',
  393. ),
  394. 'getInfo' => array
  395. (
  396. # 匹配的正则或函数 选填项
  397. 'option' => array
  398. (
  399. 'status' => 2,
  400. 'state' => 1,
  401. ),
  402. 'order' => array('id' => 'desc'),
  403. 'type' => 'one',
  404. 'col' => '*',
  405. ),
  406. 'getData' => array
  407. (
  408. # 匹配的正则或函数 选填项
  409. 'option' => array
  410. (
  411. 'idcard' => 'yes',
  412. 'id' => array('yes', '!='),
  413. 'status' => 2,
  414. 'state' => 1,
  415. ),
  416. 'order' => array('id' => 'desc'),
  417. 'type' => 'all',
  418. 'page' => array(20, 'list'),
  419. 'col' => '*',
  420. ),
  421. 'upCash' => array
  422. (
  423. 'type' => 'update',
  424. 'where' => array
  425. (
  426. 'id' => 'yes',
  427. ),
  428. 'set' => array
  429. (
  430. 'cash' => array('yes', '+='),
  431. ),
  432. ),
  433. 'upSell' => array
  434. (
  435. 'type' => 'update',
  436. 'where' => array
  437. (
  438. 'id' => 'yes',
  439. ),
  440. 'set' => array
  441. (
  442. 'cash' => array('yes', '+='),
  443. 'upcol' => array('yes-sell', '+='),
  444. 'level_id' => 'yes',
  445. ),
  446. ),
  447. 'upGroupSell' => array
  448. (
  449. 'type' => 'update',
  450. 'where' => array
  451. (
  452. 'id' => 'yes',
  453. ),
  454. 'set' => array
  455. (
  456. 'cash' => array('yes', '+='),
  457. 'upcol' => array('yes-group_sell', '+='),
  458. 'level_id' => 'yes',
  459. ),
  460. ),
  461. 'upGroupSellOne' => array
  462. (
  463. 'type' => 'update',
  464. 'where' => array
  465. (
  466. 'id' => 'yes',
  467. ),
  468. 'set' => array
  469. (
  470. 'group_sell' => array('yes', '+='),
  471. ),
  472. ),
  473. # 获取订单数量
  474. 'getNum' => array
  475. (
  476. # 匹配的正则或函数 选填项
  477. 'option' => array
  478. (
  479. 'start' => array('yes-cdate', '>='),
  480. 'end' => array('yes-cdate', '<='),
  481. 'status' => 'yes',
  482. 'role' => 'yes',
  483. 'state' => 1,
  484. ),
  485. 'type' => 'count',
  486. 'col' => '*',
  487. ),
  488. #获取所有数据
  489. 'getCount' => array
  490. (
  491. # 匹配的正则或函数 选填项
  492. 'option' => array
  493. (
  494. 'status' => 2,
  495. 'state' => 1,
  496. 'audit' => 'yes',
  497. ),
  498. // 'order' => array('id' => 'desc'),
  499. 'type' => 'count',
  500. 'col' => '*',
  501. ),
  502. ),
  503. );