account.php 12 KB

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