account.php 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471
  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}&search_option_main=2&oper_table=account&search_option_dever_auth='.$search_auth.'"');
  62. } elseif ($search_auth == 3) {
  63. $list_button['list1'] = array('子账户列表', '"member&search_option_aid={id}&search_option_main=2&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-find',
  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-find',
  125. 'col' => 'mobile',
  126. 'result' => 'id',
  127. 'search' => 'mid',
  128. ),
  129. # 读取另外表的关联方式
  130. 'sync' => array('mid', 'id'),
  131. ),
  132. 'is_email' => array
  133. (
  134. 'type' => 'tinyint-1',
  135. 'name' => '邮箱认证',
  136. 'default' => '2',
  137. 'desc' => '邮箱是否验证',
  138. 'match' => 'is_numeric',
  139. 'search' => 'select',
  140. 'option' => $is_email,
  141. 'list' => 'Dever::load("option/lib/account.getEmail", {id})',
  142. 'list_order' => 3,
  143. ),
  144. 'send_email' => array
  145. (
  146. 'type' => 'tinyint-1',
  147. 'name' => '是否发送邮件',
  148. 'default' => '2',
  149. 'desc' => '是否发送邮件',
  150. 'match' => 'is_numeric',
  151. 'update' => 'radio',
  152. 'option' => $send_email,
  153. ),
  154. 'email' => array
  155. (
  156. 'type' => 'varchar-150',
  157. 'name' => '邮箱',
  158. 'default' => '',
  159. 'desc' => '请输入邮箱',
  160. 'search' => 'fulltext',
  161. 'match' => 'option||' . Dever::rule('email'),
  162. 'update' => 'text',
  163. ),
  164. 'is_idcard' => array
  165. (
  166. 'type' => 'tinyint-1',
  167. 'name' => '身份证资料',
  168. 'default' => '2',
  169. 'desc' => '身份证资料',
  170. 'match' => 'is_numeric',
  171. 'option' => $is_idcard,
  172. 'search' => 'select',
  173. //'update' => 'radio',
  174. 'list' => $search_auth == 1 ? 'Dever::load("option/lib/account.getIdcard", {id})' : false,
  175. 'list_order' => 3,
  176. ),
  177. 'option-member-idcard'=> array
  178. (
  179. 'name' => '身份证号码',
  180. 'default' => '',
  181. 'desc' => '身份证号码',
  182. 'match' => 'option',
  183. 'search' => array
  184. (
  185. 'api' => 'option/member-find',
  186. 'col' => 'idcard',
  187. 'result' => 'id',
  188. 'search' => 'mid',
  189. ),
  190. # 读取另外表的关联方式
  191. 'sync' => array('mid', 'id'),
  192. 'list' => $search_auth == 2 ? 'Dever::load("option/lib/account.getCash#daijiaofu", {id})' : false,
  193. 'list_name' => '待交付',
  194. 'list_order' => 4,
  195. ),
  196. 'idcard_front' => array
  197. (
  198. 'type' => 'varchar-150',
  199. 'name' => '身份证正面',
  200. 'default' => '',
  201. 'desc' => '身份证正面',
  202. 'match' => 'option',
  203. 'update' => $col ? 'image' : false,
  204. 'key' => '8',
  205. //'place' => '660*660',
  206. 'list' => $search_auth == 2 ? 'Dever::load("option/lib/account.getCash#qiquan", {id})' : false,
  207. 'list_name' => '期权',
  208. 'list_order' => 5,
  209. ),
  210. 'idcard_back' => array
  211. (
  212. 'type' => 'varchar-150',
  213. 'name' => '身份证背面',
  214. 'default' => '',
  215. 'desc' => '身份证背面',
  216. 'match' => 'option',
  217. 'update' => $col ? 'image' : false,
  218. 'key' => '8',
  219. //'place' => '660*660',
  220. 'list' => $search_auth == 2 ? 'Dever::load("option/lib/account.getCash#yuanshiqiquan", {id})' : false,
  221. 'list_name' => '原始期权',
  222. 'list_order' => 6,
  223. ),
  224. 'audit' => array
  225. (
  226. 'type' => 'tinyint-1',
  227. 'name' => $search_auth == 1 ? '审核状况' : '账户认证',
  228. 'default' => $col ? '3' : '1',
  229. 'desc' => '审核状况',
  230. 'match' => 'is_numeric',
  231. 'option' => $col ? $audit_manage : $audit_search,
  232. 'search' => 'select',
  233. 'update' => $col ? 'radio' : false,
  234. 'list' => 'Dever::load("option/lib/account.getAudit", {id})',
  235. 'list_order' => $search_auth == 1 ? 5 : 3,
  236. 'value' => $col ? '3' : '1',
  237. 'control' => 'audit',
  238. ),
  239. 'audit_desc' => array
  240. (
  241. 'type' => 'varchar-500',
  242. 'name' => '审核备注',
  243. 'default' => '',
  244. 'desc' => '审核备注',
  245. 'match' => 'option',
  246. 'update' => $col ? 'textarea' : false,
  247. 'show' => 'audit=4',
  248. ),
  249. 'audit_date' => array
  250. (
  251. 'type' => 'int-11',
  252. 'name' => '审核时间',
  253. 'match' => 'is_numeric',
  254. 'desc' => '审核时间',
  255. ),
  256. 'status' => array
  257. (
  258. 'type' => 'tinyint-1',
  259. 'name' => '状态',
  260. 'default' => '1',
  261. 'desc' => '状态',
  262. 'match' => 'is_numeric',
  263. 'option' => $status,
  264. //'search' => 'select',
  265. 'list' => $search_auth == 1 ? false : true,
  266. 'list_order' => 100,
  267. ),
  268. 'stype' => array
  269. (
  270. 'type' => 'int-11',
  271. 'name' => '类型-仅用于展示类型',
  272. 'default' => '-1',
  273. 'desc' => '类型',
  274. 'match' => 'is_string',
  275. 'update' => 'text',
  276. 'search' => 'hidden',
  277. ),
  278. 'dever_auth' => array
  279. (
  280. 'name' => '权限',
  281. 'default' => '',
  282. 'desc' => '类型',
  283. 'match' => 'is_string',
  284. 'search' => 'hidden',
  285. ),
  286. 'state' => array
  287. (
  288. 'type' => 'tinyint-1',
  289. 'name' => '状态',
  290. 'default' => '1',
  291. 'desc' => '请选择状态',
  292. 'match' => 'is_numeric',
  293. ),
  294. 'cdate' => array
  295. (
  296. 'type' => 'int-11',
  297. 'name' => '创建时间',
  298. 'match' => array('is_numeric', time()),
  299. 'desc' => '',
  300. # 只有insert时才生效
  301. 'insert' => true,
  302. 'search' => 'date',
  303. 'list' => 'date("Y-m-d H:i", {cdate})',
  304. 'list_order' => 2,
  305. ),
  306. ),
  307. 'manage' => array
  308. (
  309. 'insert' => false,
  310. 'delete' => false,
  311. 'edit' => false,
  312. 'button' => $button,
  313. 'list_button' => $list_button,
  314. ),
  315. 'request' => array
  316. (
  317. 'list' => array
  318. (
  319. # 匹配的正则或函数 选填项
  320. 'option' => array
  321. (
  322. 'mid' => 'yes',
  323. 'is_email' => 'yes',
  324. 'is_idcard' => 'yes',
  325. 'email' => array('yes', 'like'),
  326. 'audit' => array('yes', 'in'),
  327. 'start_cdate' => array('yes-cdate', '>='),
  328. 'end_cdate' => array('yes-cdate', '<='),
  329. 'state' => 1,
  330. ),
  331. 'type' => 'all',
  332. 'order' => array('id' => 'desc'),
  333. 'page' => array(20, 'list'),
  334. 'col' => '*',
  335. ),
  336. 'getInfo' => array
  337. (
  338. # 匹配的正则或函数 选填项
  339. 'option' => array
  340. (
  341. 'status' => 2,
  342. 'state' => 1,
  343. ),
  344. 'order' => array('id' => 'desc'),
  345. 'type' => 'one',
  346. 'col' => '*',
  347. ),
  348. 'getData' => array
  349. (
  350. # 匹配的正则或函数 选填项
  351. 'option' => array
  352. (
  353. 'idcard' => 'yes',
  354. 'id' => array('yes', '!='),
  355. 'status' => 2,
  356. 'state' => 1,
  357. ),
  358. 'order' => array('id' => 'desc'),
  359. 'type' => 'all',
  360. 'page' => array(20, 'list'),
  361. 'col' => '*',
  362. ),
  363. 'upCash' => array
  364. (
  365. 'type' => 'update',
  366. 'where' => array
  367. (
  368. 'id' => 'yes',
  369. ),
  370. 'set' => array
  371. (
  372. 'cash' => array('yes', '+='),
  373. ),
  374. ),
  375. 'upSell' => array
  376. (
  377. 'type' => 'update',
  378. 'where' => array
  379. (
  380. 'id' => 'yes',
  381. ),
  382. 'set' => array
  383. (
  384. 'cash' => array('yes', '+='),
  385. 'upcol' => array('yes-sell', '+='),
  386. 'level_id' => 'yes',
  387. ),
  388. ),
  389. 'upGroupSell' => array
  390. (
  391. 'type' => 'update',
  392. 'where' => array
  393. (
  394. 'id' => 'yes',
  395. ),
  396. 'set' => array
  397. (
  398. 'cash' => array('yes', '+='),
  399. 'upcol' => array('yes-group_sell', '+='),
  400. 'level_id' => 'yes',
  401. ),
  402. ),
  403. 'upGroupSellOne' => array
  404. (
  405. 'type' => 'update',
  406. 'where' => array
  407. (
  408. 'id' => 'yes',
  409. ),
  410. 'set' => array
  411. (
  412. 'group_sell' => array('yes', '+='),
  413. ),
  414. ),
  415. # 获取订单数量
  416. 'getNum' => array
  417. (
  418. # 匹配的正则或函数 选填项
  419. 'option' => array
  420. (
  421. 'start' => array('yes-cdate', '>='),
  422. 'end' => array('yes-cdate', '<='),
  423. 'status' => 'yes',
  424. 'role' => 'yes',
  425. 'state' => 1,
  426. ),
  427. 'type' => 'count',
  428. 'col' => '*',
  429. ),
  430. ),
  431. );