account.php 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476
  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. 'default' => '',
  254. 'match' => 'is_numeric',
  255. 'desc' => '审核时间',
  256. 'list_name' => '合同审核状态',
  257. 'list' => $search_auth == 3 ? 'Dever::load("option/lib/account.getAgreementStatus", {id})' : false,
  258. 'list_order' => 10,
  259. ),
  260. 'status' => array
  261. (
  262. 'type' => 'tinyint-1',
  263. 'name' => '状态',
  264. 'default' => '1',
  265. 'desc' => '状态',
  266. 'match' => 'is_numeric',
  267. 'option' => $status,
  268. //'search' => 'select',
  269. 'list' => $search_auth == 1 ? false : true,
  270. 'list_order' => 100,
  271. ),
  272. 'stype' => array
  273. (
  274. 'type' => 'int-11',
  275. 'name' => '类型-仅用于展示类型',
  276. 'default' => '-1',
  277. 'desc' => '类型',
  278. 'match' => 'is_string',
  279. 'update' => 'text',
  280. 'search' => 'hidden',
  281. ),
  282. 'dever_auth' => array
  283. (
  284. 'name' => '权限',
  285. 'default' => '',
  286. 'desc' => '类型',
  287. 'match' => 'is_string',
  288. 'search' => 'hidden',
  289. ),
  290. 'state' => array
  291. (
  292. 'type' => 'tinyint-1',
  293. 'name' => '状态',
  294. 'default' => '1',
  295. 'desc' => '请选择状态',
  296. 'match' => 'is_numeric',
  297. ),
  298. 'cdate' => array
  299. (
  300. 'type' => 'int-11',
  301. 'name' => '创建时间',
  302. 'match' => array('is_numeric', time()),
  303. 'desc' => '',
  304. # 只有insert时才生效
  305. 'insert' => true,
  306. 'search' => 'date',
  307. 'list' => 'date("Y-m-d H:i", {cdate})',
  308. 'list_order' => 2,
  309. ),
  310. ),
  311. 'manage' => array
  312. (
  313. 'insert' => false,
  314. 'delete' => false,
  315. 'edit' => false,
  316. 'button' => $button,
  317. 'list_button' => $list_button,
  318. ),
  319. 'request' => array
  320. (
  321. 'list' => array
  322. (
  323. # 匹配的正则或函数 选填项
  324. 'option' => array
  325. (
  326. 'mid' => 'yes',
  327. 'is_email' => 'yes',
  328. 'is_idcard' => 'yes',
  329. 'email' => array('yes', 'like'),
  330. 'audit' => array('yes', 'in'),
  331. 'start_cdate' => array('yes-cdate', '>='),
  332. 'end_cdate' => array('yes-cdate', '<='),
  333. 'state' => 1,
  334. ),
  335. 'type' => 'all',
  336. 'order' => array('id' => 'desc'),
  337. 'page' => array(20, 'list'),
  338. 'col' => '*',
  339. ),
  340. 'getInfo' => array
  341. (
  342. # 匹配的正则或函数 选填项
  343. 'option' => array
  344. (
  345. 'status' => 2,
  346. 'state' => 1,
  347. ),
  348. 'order' => array('id' => 'desc'),
  349. 'type' => 'one',
  350. 'col' => '*',
  351. ),
  352. 'getData' => array
  353. (
  354. # 匹配的正则或函数 选填项
  355. 'option' => array
  356. (
  357. 'idcard' => 'yes',
  358. 'id' => array('yes', '!='),
  359. 'status' => 2,
  360. 'state' => 1,
  361. ),
  362. 'order' => array('id' => 'desc'),
  363. 'type' => 'all',
  364. 'page' => array(20, 'list'),
  365. 'col' => '*',
  366. ),
  367. 'upCash' => array
  368. (
  369. 'type' => 'update',
  370. 'where' => array
  371. (
  372. 'id' => 'yes',
  373. ),
  374. 'set' => array
  375. (
  376. 'cash' => array('yes', '+='),
  377. ),
  378. ),
  379. 'upSell' => array
  380. (
  381. 'type' => 'update',
  382. 'where' => array
  383. (
  384. 'id' => 'yes',
  385. ),
  386. 'set' => array
  387. (
  388. 'cash' => array('yes', '+='),
  389. 'upcol' => array('yes-sell', '+='),
  390. 'level_id' => 'yes',
  391. ),
  392. ),
  393. 'upGroupSell' => array
  394. (
  395. 'type' => 'update',
  396. 'where' => array
  397. (
  398. 'id' => 'yes',
  399. ),
  400. 'set' => array
  401. (
  402. 'cash' => array('yes', '+='),
  403. 'upcol' => array('yes-group_sell', '+='),
  404. 'level_id' => 'yes',
  405. ),
  406. ),
  407. 'upGroupSellOne' => array
  408. (
  409. 'type' => 'update',
  410. 'where' => array
  411. (
  412. 'id' => 'yes',
  413. ),
  414. 'set' => array
  415. (
  416. 'group_sell' => array('yes', '+='),
  417. ),
  418. ),
  419. # 获取订单数量
  420. 'getNum' => array
  421. (
  422. # 匹配的正则或函数 选填项
  423. 'option' => array
  424. (
  425. 'start' => array('yes-cdate', '>='),
  426. 'end' => array('yes-cdate', '<='),
  427. 'status' => 'yes',
  428. 'role' => 'yes',
  429. 'state' => 1,
  430. ),
  431. 'type' => 'count',
  432. 'col' => '*',
  433. ),
  434. ),
  435. );