account.php 14 KB

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