account.php 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494
  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_dever_auth='.$search_auth.'"');
  62. } elseif ($search_auth == 3) {
  63. $list_button['list1'] = array('账户列表', '"member&search_option_aid={id}&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-getOne',
  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-getOne',
  125. 'col' => 'mobile',
  126. 'result' => 'id',
  127. 'search' => 'mid',
  128. ),
  129. # 读取另外表的关联方式
  130. 'sync' => array('mid', 'id'),
  131. ),
  132. 'option-member-key'=> array
  133. (
  134. 'name' => '索引号',
  135. 'default' => '',
  136. 'desc' => '索引号',
  137. 'match' => 'option',
  138. 'search' => array
  139. (
  140. 'api' => 'option/member-getOne',
  141. 'col' => 'key',
  142. 'result' => 'id',
  143. 'search' => 'mid',
  144. ),
  145. # 读取另外表的关联方式
  146. 'sync' => array('mid', 'id'),
  147. ),
  148. 'is_email' => array
  149. (
  150. 'type' => 'tinyint-1',
  151. 'name' => '邮箱认证',
  152. 'default' => '2',
  153. 'desc' => '邮箱是否验证',
  154. 'match' => 'is_numeric',
  155. 'search' => 'select',
  156. 'option' => $is_email,
  157. 'list' => 'Dever::load("option/lib/account.getEmail", {id})',
  158. 'list_order' => 3,
  159. ),
  160. 'send_email' => array
  161. (
  162. 'type' => 'tinyint-1',
  163. 'name' => '是否发送邮件',
  164. 'default' => '2',
  165. 'desc' => '是否发送邮件',
  166. 'match' => 'is_numeric',
  167. 'update' => 'radio',
  168. 'option' => $send_email,
  169. ),
  170. 'email' => array
  171. (
  172. 'type' => 'varchar-150',
  173. 'name' => '邮箱',
  174. 'default' => '',
  175. 'desc' => '请输入邮箱',
  176. 'search' => 'fulltext',
  177. 'match' => 'option||' . Dever::rule('email'),
  178. 'update' => 'text',
  179. ),
  180. 'is_idcard' => array
  181. (
  182. 'type' => 'tinyint-1',
  183. 'name' => '身份证资料',
  184. 'default' => '2',
  185. 'desc' => '身份证资料',
  186. 'match' => 'is_numeric',
  187. 'option' => $is_idcard,
  188. 'search' => 'select',
  189. //'update' => 'radio',
  190. 'list' => $search_auth == 1 ? 'Dever::load("option/lib/account.getIdcard", {id})' : false,
  191. 'list_order' => 3,
  192. 'list_header' => array('width' => '30%'),
  193. ),
  194. 'option-member-idcard'=> array
  195. (
  196. 'name' => '身份证号码',
  197. 'default' => '',
  198. 'desc' => '身份证号码',
  199. 'match' => 'option',
  200. 'search' => array
  201. (
  202. 'api' => 'option/member-getOne',
  203. 'col' => 'idcard',
  204. 'result' => 'id',
  205. 'search' => 'mid',
  206. ),
  207. # 读取另外表的关联方式
  208. 'sync' => array('mid', 'id'),
  209. 'list' => $search_auth == 2 ? 'Dever::load("option/lib/account.getCash#daijiaofu", {id})' : false,
  210. 'list_name' => '待交付',
  211. 'list_order' => 4,
  212. ),
  213. 'idcard_front' => array
  214. (
  215. 'type' => 'varchar-150',
  216. 'name' => '身份证正面',
  217. 'default' => '',
  218. 'desc' => '身份证正面',
  219. 'match' => 'option',
  220. 'update' => $col ? 'image' : false,
  221. 'key' => '8',
  222. //'place' => '660*660',
  223. 'list' => $search_auth == 2 ? 'Dever::load("option/lib/account.getCash#qiquan", {id})' : false,
  224. 'list_name' => '期权',
  225. 'list_order' => 5,
  226. ),
  227. 'idcard_back' => array
  228. (
  229. 'type' => 'varchar-150',
  230. 'name' => '身份证背面',
  231. 'default' => '',
  232. 'desc' => '身份证背面',
  233. 'match' => 'option',
  234. 'update' => $col ? 'image' : false,
  235. 'key' => '8',
  236. //'place' => '660*660',
  237. 'list' => $search_auth == 2 ? 'Dever::load("option/lib/account.getCash#yuanshiqiquan", {id})' : false,
  238. 'list_name' => '原始期权',
  239. 'list_order' => 6,
  240. ),
  241. 'audit' => array
  242. (
  243. 'type' => 'tinyint-1',
  244. 'name' => $search_auth == 1 ? '审核状况' : '账户认证',
  245. 'default' => $col ? '3' : '1',
  246. 'desc' => '审核状况',
  247. 'match' => 'is_numeric',
  248. 'option' => $col ? $audit_manage : $audit_search,
  249. 'search' => 'select',
  250. 'update' => $col ? 'radio' : false,
  251. 'list' => 'Dever::load("option/lib/account.getAudit", {id})',
  252. 'list_order' => $search_auth == 1 ? 5 : 3,
  253. 'value' => $col ? '3' : '1',
  254. 'control' => 'audit',
  255. ),
  256. 'audit_desc' => array
  257. (
  258. 'type' => 'varchar-500',
  259. 'name' => '审核备注',
  260. 'default' => '',
  261. 'desc' => '审核备注',
  262. 'match' => 'option',
  263. 'update' => $col ? 'textarea' : false,
  264. 'show' => 'audit=4',
  265. ),
  266. 'audit_date' => array
  267. (
  268. 'type' => 'int-11',
  269. 'name' => '审核时间',
  270. 'default' => '',
  271. 'match' => 'is_numeric',
  272. 'desc' => '审核时间',
  273. 'list_name' => '合同审核状态',
  274. 'list' => $search_auth == 3 ? 'Dever::load("option/lib/account.getAgreementStatus", {id})' : false,
  275. 'list_order' => 10,
  276. ),
  277. 'status' => array
  278. (
  279. 'type' => 'tinyint-1',
  280. 'name' => '状态',
  281. 'default' => '1',
  282. 'desc' => '状态',
  283. 'match' => 'is_numeric',
  284. 'option' => $status,
  285. //'search' => 'select',
  286. 'list' => $search_auth == 1 ? false : true,
  287. 'list_order' => 100,
  288. ),
  289. 'stype' => array
  290. (
  291. 'type' => 'int-11',
  292. 'name' => '类型-仅用于展示类型',
  293. 'default' => '-1',
  294. 'desc' => '类型',
  295. 'match' => 'is_string',
  296. 'update' => 'text',
  297. 'search' => 'hidden',
  298. ),
  299. 'dever_auth' => array
  300. (
  301. 'name' => '权限',
  302. 'default' => '',
  303. 'desc' => '类型',
  304. 'match' => 'is_string',
  305. 'search' => 'hidden',
  306. ),
  307. 'state' => array
  308. (
  309. 'type' => 'tinyint-1',
  310. 'name' => '状态',
  311. 'default' => '1',
  312. 'desc' => '请选择状态',
  313. 'match' => 'is_numeric',
  314. ),
  315. 'cdate' => array
  316. (
  317. 'type' => 'int-11',
  318. 'name' => '创建时间',
  319. 'match' => array('is_numeric', time()),
  320. 'desc' => '',
  321. # 只有insert时才生效
  322. 'insert' => true,
  323. 'search' => 'date',
  324. 'list' => 'date("Y-m-d H:i", {cdate})',
  325. 'list_order' => 2,
  326. ),
  327. ),
  328. 'manage' => array
  329. (
  330. 'insert' => false,
  331. 'delete' => false,
  332. 'edit' => false,
  333. 'button' => $button,
  334. 'list_button' => $list_button,
  335. ),
  336. 'request' => array
  337. (
  338. 'list' => array
  339. (
  340. # 匹配的正则或函数 选填项
  341. 'option' => array
  342. (
  343. 'mid' => 'yes',
  344. 'is_email' => 'yes',
  345. 'is_idcard' => 'yes',
  346. 'email' => array('yes', 'like'),
  347. 'audit' => array('yes', 'in'),
  348. 'start_cdate' => array('yes-cdate', '>='),
  349. 'end_cdate' => array('yes-cdate', '<='),
  350. 'state' => 1,
  351. ),
  352. 'type' => 'all',
  353. 'order' => array('id' => 'desc'),
  354. 'page' => array(20, 'list'),
  355. 'col' => '*',
  356. ),
  357. 'getInfo' => array
  358. (
  359. # 匹配的正则或函数 选填项
  360. 'option' => array
  361. (
  362. 'status' => 2,
  363. 'state' => 1,
  364. ),
  365. 'order' => array('id' => 'desc'),
  366. 'type' => 'one',
  367. 'col' => '*',
  368. ),
  369. 'getData' => array
  370. (
  371. # 匹配的正则或函数 选填项
  372. 'option' => array
  373. (
  374. 'idcard' => 'yes',
  375. 'id' => array('yes', '!='),
  376. 'status' => 2,
  377. 'state' => 1,
  378. ),
  379. 'order' => array('id' => 'desc'),
  380. 'type' => 'all',
  381. 'page' => array(20, 'list'),
  382. 'col' => '*',
  383. ),
  384. 'upCash' => array
  385. (
  386. 'type' => 'update',
  387. 'where' => array
  388. (
  389. 'id' => 'yes',
  390. ),
  391. 'set' => array
  392. (
  393. 'cash' => array('yes', '+='),
  394. ),
  395. ),
  396. 'upSell' => array
  397. (
  398. 'type' => 'update',
  399. 'where' => array
  400. (
  401. 'id' => 'yes',
  402. ),
  403. 'set' => array
  404. (
  405. 'cash' => array('yes', '+='),
  406. 'upcol' => array('yes-sell', '+='),
  407. 'level_id' => 'yes',
  408. ),
  409. ),
  410. 'upGroupSell' => array
  411. (
  412. 'type' => 'update',
  413. 'where' => array
  414. (
  415. 'id' => 'yes',
  416. ),
  417. 'set' => array
  418. (
  419. 'cash' => array('yes', '+='),
  420. 'upcol' => array('yes-group_sell', '+='),
  421. 'level_id' => 'yes',
  422. ),
  423. ),
  424. 'upGroupSellOne' => array
  425. (
  426. 'type' => 'update',
  427. 'where' => array
  428. (
  429. 'id' => 'yes',
  430. ),
  431. 'set' => array
  432. (
  433. 'group_sell' => array('yes', '+='),
  434. ),
  435. ),
  436. # 获取订单数量
  437. 'getNum' => array
  438. (
  439. # 匹配的正则或函数 选填项
  440. 'option' => array
  441. (
  442. 'start' => array('yes-cdate', '>='),
  443. 'end' => array('yes-cdate', '<='),
  444. 'status' => 'yes',
  445. 'role' => 'yes',
  446. 'state' => 1,
  447. ),
  448. 'type' => 'count',
  449. 'col' => '*',
  450. ),
  451. ),
  452. );