account.php 12 KB

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