account.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438
  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. 'search' => 'select',
  161. //'update' => 'radio',
  162. 'list' => !$search_audit ? false : true,
  163. 'list_order' => 3,
  164. ),
  165. 'option-member-idcard'=> array
  166. (
  167. 'name' => '身份证号码',
  168. 'default' => '',
  169. 'desc' => '身份证号码',
  170. 'match' => 'option',
  171. 'search' => array
  172. (
  173. 'api' => 'option/member-find',
  174. 'col' => 'idcard',
  175. 'result' => 'id',
  176. 'search' => 'mid',
  177. ),
  178. # 读取另外表的关联方式
  179. 'sync' => array('mid', 'id'),
  180. 'list' => !$search_audit ? 'Dever::load("option/lib/account.getCash#daijiaofu", {id})' : false,
  181. 'list_name' => '待交付',
  182. 'list_order' => 4,
  183. ),
  184. 'idcard_front' => array
  185. (
  186. 'type' => 'varchar-150',
  187. 'name' => '身份证正面',
  188. 'default' => '',
  189. 'desc' => '身份证正面',
  190. 'match' => 'option',
  191. 'update' => $col ? 'image' : false,
  192. 'key' => '8',
  193. //'place' => '660*660',
  194. 'list' => !$search_audit ? 'Dever::load("option/lib/account.getCash#qiquan", {id})' : false,
  195. 'list_name' => '期权',
  196. 'list_order' => 5,
  197. ),
  198. 'idcard_back' => array
  199. (
  200. 'type' => 'varchar-150',
  201. 'name' => '身份证背面',
  202. 'default' => '',
  203. 'desc' => '身份证背面',
  204. 'match' => 'option',
  205. 'update' => $col ? 'image' : false,
  206. 'key' => '8',
  207. //'place' => '660*660',
  208. 'list' => !$search_audit ? 'Dever::load("option/lib/account.getCash#yuanshiqiquan", {id})' : false,
  209. 'list_name' => '原始期权',
  210. 'list_order' => 6,
  211. ),
  212. 'audit' => array
  213. (
  214. 'type' => 'tinyint-1',
  215. 'name' => !$search_audit ? '账户认证' : '审核状况',
  216. 'default' => $col ? '3' : '1',
  217. 'desc' => '审核状况',
  218. 'match' => 'is_numeric',
  219. 'option' => $audit_manage,
  220. 'search' => 'select',
  221. 'update' => $col ? 'radio' : false,
  222. 'list' => 'Dever::load("option/lib/account.getAudit", {id})',
  223. 'list_order' => !$search_audit ? 3 : 5,
  224. 'value' => $col ? '3' : '1',
  225. 'control' => 'audit',
  226. ),
  227. 'audit_desc' => array
  228. (
  229. 'type' => 'varchar-500',
  230. 'name' => '审核备注',
  231. 'default' => '',
  232. 'desc' => '审核备注',
  233. 'match' => 'option',
  234. 'update' => $col ? 'textarea' : false,
  235. 'show' => 'audit=4',
  236. ),
  237. 'audit_date' => array
  238. (
  239. 'type' => 'int-11',
  240. 'name' => '审核时间',
  241. 'match' => 'is_numeric',
  242. 'desc' => '审核时间',
  243. ),
  244. 'status' => array
  245. (
  246. 'type' => 'tinyint-1',
  247. 'name' => '状态',
  248. 'default' => '1',
  249. 'desc' => '状态',
  250. 'match' => 'is_numeric',
  251. 'option' => $status,
  252. //'search' => 'select',
  253. 'list' => !$search_audit ? true : false,
  254. 'list_order' => 100,
  255. ),
  256. 'state' => array
  257. (
  258. 'type' => 'tinyint-1',
  259. 'name' => '状态',
  260. 'default' => '1',
  261. 'desc' => '请选择状态',
  262. 'match' => 'is_numeric',
  263. ),
  264. 'cdate' => array
  265. (
  266. 'type' => 'int-11',
  267. 'name' => '创建时间',
  268. 'match' => array('is_numeric', time()),
  269. 'desc' => '',
  270. # 只有insert时才生效
  271. 'insert' => true,
  272. 'search' => 'date',
  273. 'list' => 'date("Y-m-d H:i", {cdate})',
  274. 'list_order' => 2,
  275. ),
  276. ),
  277. 'manage' => array
  278. (
  279. 'insert' => false,
  280. 'delete' => false,
  281. 'edit' => false,
  282. 'button' => $button,
  283. 'list_button' => $list_button,
  284. ),
  285. 'request' => array
  286. (
  287. 'list' => array
  288. (
  289. # 匹配的正则或函数 选填项
  290. 'option' => array
  291. (
  292. //'mid' => 'yes',
  293. 'is_email' => 'yes',
  294. 'is_idcard' => 'yes',
  295. 'email' => array('yes', 'like'),
  296. 'audit' => array('yes', 'in'),
  297. 'start_cdate' => array('yes-cdate', '>='),
  298. 'end_cdate' => array('yes-cdate', '<='),
  299. 'state' => 1,
  300. ),
  301. 'type' => 'all',
  302. 'order' => array('id' => 'desc'),
  303. 'page' => array(20, 'list'),
  304. 'col' => '*',
  305. ),
  306. 'getInfo' => array
  307. (
  308. # 匹配的正则或函数 选填项
  309. 'option' => array
  310. (
  311. 'status' => 2,
  312. 'state' => 1,
  313. ),
  314. 'order' => array('id' => 'desc'),
  315. 'type' => 'one',
  316. 'col' => '*',
  317. ),
  318. 'getData' => array
  319. (
  320. # 匹配的正则或函数 选填项
  321. 'option' => array
  322. (
  323. 'idcard' => 'yes',
  324. 'id' => array('yes', '!='),
  325. 'status' => 2,
  326. 'state' => 1,
  327. ),
  328. 'order' => array('id' => 'desc'),
  329. 'type' => 'all',
  330. 'page' => array(20, 'list'),
  331. 'col' => '*',
  332. ),
  333. 'upCash' => array
  334. (
  335. 'type' => 'update',
  336. 'where' => array
  337. (
  338. 'id' => 'yes',
  339. ),
  340. 'set' => array
  341. (
  342. 'cash' => array('yes', '+='),
  343. ),
  344. ),
  345. 'upSell' => array
  346. (
  347. 'type' => 'update',
  348. 'where' => array
  349. (
  350. 'id' => 'yes',
  351. ),
  352. 'set' => array
  353. (
  354. 'cash' => array('yes', '+='),
  355. 'upcol' => array('yes-sell', '+='),
  356. 'level_id' => 'yes',
  357. ),
  358. ),
  359. 'upGroupSell' => array
  360. (
  361. 'type' => 'update',
  362. 'where' => array
  363. (
  364. 'id' => 'yes',
  365. ),
  366. 'set' => array
  367. (
  368. 'cash' => array('yes', '+='),
  369. 'upcol' => array('yes-group_sell', '+='),
  370. 'level_id' => 'yes',
  371. ),
  372. ),
  373. 'upGroupSellOne' => array
  374. (
  375. 'type' => 'update',
  376. 'where' => array
  377. (
  378. 'id' => 'yes',
  379. ),
  380. 'set' => array
  381. (
  382. 'group_sell' => array('yes', '+='),
  383. ),
  384. ),
  385. # 获取订单数量
  386. 'getNum' => array
  387. (
  388. # 匹配的正则或函数 选填项
  389. 'option' => array
  390. (
  391. 'start' => array('yes-cdate', '>='),
  392. 'end' => array('yes-cdate', '<='),
  393. 'status' => 'yes',
  394. 'role' => 'yes',
  395. 'state' => 1,
  396. ),
  397. 'type' => 'count',
  398. 'col' => '*',
  399. ),
  400. ),
  401. );