account.php 12 KB

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