tixian.php 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459
  1. <?php
  2. $status = array
  3. (
  4. -1 => array('name' => '未审核待发放', 'style' => 'font-weight:bold;color:#436EEE'),
  5. 1 => array('name' => '已审核待发放', 'style' => 'font-weight:bold;color:green'),
  6. //2 => array('name' => '已审核待发放', 'style' => 'font-weight:bold;color:green'),
  7. 2 => array('name' => '已发放', 'style' => 'font-weight:bold;color:#CD3700'),
  8. 3 => array('name' => '已作废','style' => 'font-weight:bold;color:#CD3700'),
  9. );
  10. $cash_status = array
  11. (
  12. 1 => array('name' => '待审核', 'style' => 'font-weight:bold;color:#436EEE'),
  13. 2 => array('name' => '已审核', 'style' => 'font-weight:bold;color:green'),
  14. 3 => array('name' => '已作废', 'style' => 'font-weight:bold;color:#CD3700'),
  15. );
  16. $manage_status = array
  17. (
  18. //1 => '待发放',
  19. 2 => '已发放',
  20. 3 => '已作废',
  21. );
  22. $type = array
  23. (
  24. 1 => '代理商提现',
  25. 2 => '门店提现',
  26. 3 => '用户钱包提现',
  27. );
  28. $list_button = array();
  29. $list_button['list'] = array('查看详情', '"push_cash&project=bill&id={cash_id}&page_type=1&[refer]"', '{type} == 1');
  30. $list_button['list1'] = array('查看详情', '"record&project=shop&id={cash_id}&page_type=1&[refer]"', '{type} == 2');
  31. $list_button['list2'] = array('查看详情', '"user_money_sign&project=shop&id={cash_id}&page_type=1&[refer]"', '{type} == 3');
  32. if (Dever::load('manage/auth')->checkFunc('bill.tixian', 'edit1', '发放')) {
  33. $list_button['fast'] = array('发放', '"tixian&where_id={id}&col=audit,audit_desc,pic&oper_save_jump=tixian&oper_table=tixian&oper_parent=tixian"', '{status} == 1 && "{bill-cash-status}" == 2');
  34. }
  35. $mid = Dever::input('search_option_mid');
  36. $mul = false;
  37. if (Dever::load('manage/auth')->checkFunc('bill.tixian', 'fafangedit', '批量发放')) {
  38. $mul = '{status} == 1';
  39. }
  40. $admin = Dever::load('manage/auth.info');
  41. $admin_auth = false;
  42. if ($admin && $admin['role'] == 24){
  43. $admin_auth = $admin['role'];
  44. }
  45. return array
  46. (
  47. # 表名
  48. 'name' => 'tixian',
  49. # 显示给用户看的名称
  50. 'lang' => '提现管理',
  51. 'auto' => 100000,
  52. 'set' => array
  53. (
  54. 'status' => $status,
  55. ),
  56. 'end' => array
  57. (
  58. 'update' => 'bill/lib/manage.tixianAuditUpdate',
  59. 'updatemul' => 'bill/lib/manage.tixianAuditUpdate',
  60. ),
  61. 'order' => 80,
  62. # 数据结构
  63. 'struct' => array
  64. (
  65. 'id' => array
  66. (
  67. 'type' => 'int-11',
  68. 'name' => 'ID',
  69. 'default' => '',
  70. 'desc' => '',
  71. 'match' => 'is_numeric',
  72. 'search' => 'order',
  73. //'list' => true,
  74. ),
  75. 'type' => array
  76. (
  77. 'type' => 'int-11',
  78. 'name' => '提现类型',
  79. 'default' => '1',
  80. 'desc' => '提现类型',
  81. 'match' => 'is_numeric',
  82. 'search' => 'select',
  83. 'option' => $type,
  84. ),
  85. 'mid' => array
  86. (
  87. 'type' => 'int-11',
  88. 'name' => '代理商姓名/手机号',
  89. 'default' => '-1',
  90. 'desc' => '代理商',
  91. 'match' => 'is_string',
  92. 'update' => 'text',
  93. 'search' => array
  94. (
  95. 'api' => 'agent/member-getSearch',
  96. 'col' => 'col',
  97. 'result' => 'id',
  98. 'search' => 'mid',
  99. ),
  100. 'list_name' => '提现用户信息',
  101. 'list' => $admin_auth ? 'Dever::load("bill/lib/tixian.getInfo", {type}, {mid},true)' : 'Dever::load("bill/lib/tixian.getInfo", {type}, {mid})',
  102. 'list_order' => 3,
  103. ),
  104. 'agent-member-name'=> array
  105. (
  106. 'name' => '姓名',
  107. 'default' => '',
  108. 'desc' => '姓名',
  109. 'match' => 'option',
  110. # 读取另外表的关联方式
  111. 'sync' => array('mid', 'id'),
  112. ),
  113. 'agent-member-role'=> array
  114. (
  115. 'name' => '代理角色',
  116. 'default' => '',
  117. 'desc' => '代理角色',
  118. 'match' => 'option',
  119. # 读取另外表的关联方式
  120. 'sync' => array('mid', 'id'),
  121. // 'list' => 'Dever::load("setting/role-find#name", "{agent-member-role}")',
  122. // 'list_order' => 5,
  123. ),
  124. 'order_num' => array
  125. (
  126. 'type' => 'varchar-100',
  127. 'name' => '流水号',
  128. 'default' => '',
  129. 'desc' => '流水号',
  130. 'match' => 'is_string',
  131. 'update' => 'text',
  132. 'search' => 'fulltext',
  133. 'list' => true,
  134. 'list_name' => '流水号<br />交易时间<br />发放时间',
  135. 'list' => 'Dever::load("bill/lib/tixian.order_num#name",{id})',
  136. 'list_order' => 1,
  137. ),
  138. 'ycash' => array
  139. (
  140. 'type' => 'decimal-11,2',
  141. 'name' => '提现金额',
  142. 'default' => '0',
  143. 'desc' => '金额',
  144. 'match' => 'is_numeric',
  145. 'update' => 'text',
  146. 'list' => true,
  147. 'list_name' => '提现金额<br />实际提现金额<br />提现后余额',
  148. 'list' => 'Dever::load("bill/lib/tixian.order_num#money",{id})',
  149. 'list_order' => 6,
  150. ),
  151. 'cash' => array
  152. (
  153. 'type' => 'decimal-11,2',
  154. 'name' => '实际提现金额',
  155. 'default' => '0',
  156. 'desc' => '提现金额',
  157. 'match' => 'is_numeric',
  158. 'update' => 'text',
  159. // 'list' => true,
  160. // 'list_order' => 7,
  161. ),
  162. 'yue' => array
  163. (
  164. 'type' => 'decimal-11,2',
  165. 'name' => '提现后余额',
  166. 'default' => '0',
  167. 'desc' => '提现后余额',
  168. 'match' => 'is_numeric',
  169. 'update' => 'text',
  170. // 'list' => true,
  171. // 'list_order' => 8,
  172. ),
  173. 'cash_id' => array
  174. (
  175. 'type' => 'int-11',
  176. 'name' => '资金表id',
  177. 'default' => '',
  178. 'desc' => '资金表id',
  179. 'match' => 'is_string',
  180. 'update' => 'text',
  181. ),
  182. 'bill-cash-status'=> array
  183. (
  184. 'name' => '交易状态',
  185. 'default' => '',
  186. 'desc' => '交易状态',
  187. 'match' => 'option',
  188. # 读取另外表的关联方式
  189. 'sync' => array('cash_id', 'id'),
  190. // 'search' => 'select',
  191. //'list' => true,
  192. 'option' => $cash_status,
  193. //'list_name' => '交易状态<br />发放状态',
  194. //'list' => 'Dever::load("bill/lib/tixian.order_num#status",{id})',
  195. //'list_order' => 9,
  196. ),
  197. 'status' => array
  198. (
  199. 'type' => 'int-11',
  200. 'name' => '发放状态',
  201. 'default' => '1',
  202. 'desc' => '发放状态',
  203. 'match' => 'is_numeric',
  204. 'update' => 'hidden',
  205. 'option' => $status,
  206. 'search' => 'select',
  207. // 'list' => true,
  208. // 'list_order' => 10,
  209. 'list_name' => '交易状态',
  210. 'list' => true,
  211. 'list_order' => 9,
  212. ),
  213. 'audit' => array
  214. (
  215. 'type' => 'int-11',
  216. 'name' => '审核状态',
  217. 'default' => '2',
  218. 'desc' => '审核状态',
  219. 'match' => 'is_numeric',
  220. 'update' => 'radio',
  221. 'option' => $manage_status,
  222. 'mul' => true,
  223. 'control' => 'audit',
  224. ),
  225. 'audit_desc' => array
  226. (
  227. 'type' => 'varchar-600',
  228. 'name' => '备注',
  229. 'default' => '',
  230. 'desc' => '审核说明',
  231. 'match' => 'is_string',
  232. 'update' => 'textarea',
  233. 'list' => '"{audit_desc}" ? "{audit_desc}" : "-"',
  234. 'list_order' => 12,
  235. 'show' => 'audit=3',
  236. ),
  237. 'pic' => array
  238. (
  239. 'type' => 'text-255',
  240. 'name' => '凭证',
  241. 'default' => '',
  242. 'desc' => '请选择凭证',
  243. 'match' => 'option',
  244. 'update' => 'images',
  245. 'key' => '1',
  246. 'place' => '150',
  247. 'show' => 'audit=2',
  248. ),
  249. 'sign' => array
  250. (
  251. 'type' => 'varchar-150',
  252. 'name' => '手写签名',
  253. 'default' => '',
  254. 'desc' => '手写签名',
  255. 'match' => 'option',
  256. 'update' => 'image',
  257. 'key' => '7',
  258. 'list' => '"<img src=\'{sign}\' width=\'150\'>"',
  259. ),
  260. 'operdate' => array
  261. (
  262. 'type' => 'int-11',
  263. 'name' => '发放时间',
  264. 'default' => '',
  265. 'match' => 'is_numeric',
  266. 'desc' => '',
  267. // 'list' => '"{operdate}" > 0 ? date("Y-m-d H:i", {operdate}) : "-"',
  268. // 'list_order' => 11,
  269. ),
  270. 'audit_admin' => array
  271. (
  272. 'type' => 'int-11',
  273. 'name' => '操作人',
  274. 'default' => '',
  275. 'match' => 'is_numeric',
  276. 'desc' => '操作人',
  277. 'list' => '"{audit_admin}" > 0 ? Dever::load("manage/admin-find#username", {audit_admin}) : "-"',
  278. // 'list_order' => 8,
  279. ),
  280. 'state' => array
  281. (
  282. 'type' => 'tinyint-1',
  283. 'name' => '状态',
  284. 'default' => '1',
  285. 'desc' => '请选择状态',
  286. 'match' => 'is_numeric',
  287. ),
  288. 'cdate' => array
  289. (
  290. 'type' => 'int-11',
  291. 'name' => '交易时间',
  292. 'match' => array('is_numeric', time()),
  293. 'desc' => '',
  294. # 只有insert时才生效
  295. 'insert' => true,
  296. 'search' => 'date',
  297. // 'list' => 'date("Y-m-d H:i", {cdate})',
  298. // 'list_order' => 2,
  299. ),
  300. ),
  301. 'manage' => array
  302. (
  303. 'insert' => false,
  304. 'delete' => false,
  305. 'edit' => false,
  306. 'mul' => $mul,
  307. 'list_button' => $list_button,
  308. 'excel' => array
  309. (
  310. array('数据导出','提现数据导出', 'bill/lib/manage.tixian_out'),
  311. ),
  312. ),
  313. 'request' => array
  314. (
  315. 'getData' => array
  316. (
  317. # 匹配的正则或函数 选填项
  318. 'option' => array
  319. (
  320. 'mid' => 'yes',
  321. 'state' => 1,
  322. ),
  323. 'order' => array('id' => 'desc'),
  324. 'page' => array(10, 'list'),
  325. 'type' => 'all',
  326. 'col' => '*',
  327. ),
  328. 'getNew' => array
  329. (
  330. # 匹配的正则或函数 选填项
  331. 'option' => array
  332. (
  333. 'mid' => 'yes',
  334. 'state' => 1,
  335. ),
  336. 'order' => array('id' => 'desc'),
  337. 'type' => 'one',
  338. 'col' => '*',
  339. ),
  340. 'gettxCash' => array
  341. (
  342. # 匹配的正则或函数 选填项
  343. 'option' => array
  344. (
  345. 'start' => array('yes-cdate', '>='),
  346. 'end' => array('yes-cdate', '<='),
  347. 'status' => array('yes', 'in'),
  348. 'state' => 1,
  349. ),
  350. 'type' => 'one',
  351. 'col' => 'sum(cash) as total',
  352. ),
  353. // 'getdfCash' => array
  354. // (
  355. // # 匹配的正则或函数 选填项
  356. // 'option' => array
  357. // (
  358. // 'start' => array('yes-cdate', '>='),
  359. // 'end' => array('yes-cdate', '<='),
  360. // 'status' => array('yes', 'in'),
  361. // 'state' => 1,
  362. // ),
  363. // 'type' => 'one',
  364. // 'col' => 'sum(cash) as total',
  365. // ),
  366. 'getwsCash' => array
  367. (
  368. # 匹配的正则或函数 选填项
  369. 'option' => array
  370. (
  371. 'start' => array('yes-cdate', '>='),
  372. 'end' => array('yes-cdate', '<='),
  373. 'status' => array('yes', 'in'),
  374. 'state' => 1,
  375. ),
  376. 'type' => 'one',
  377. 'col' => 'sum(cash) as total',
  378. ),
  379. 'upStatus' => array
  380. (
  381. 'type' => 'update',
  382. 'where' => array
  383. (
  384. 'id' => 'yes',
  385. ),
  386. 'set' => array
  387. (
  388. 'status' =>'yes',
  389. 'bill-cash-status'=>'yes',
  390. ),
  391. ),
  392. 'getExcelAll' => array
  393. (
  394. # 匹配的正则或函数 选填项
  395. 'option' => array
  396. (
  397. 'start' => array('yes-cdate', '>='),
  398. 'end' => array('yes-cdate', '<='),
  399. 'status' => array('yes', 'in'),
  400. 'state' => 1,
  401. ),
  402. 'type' => 'All',
  403. 'order' => array('cdate' => 'desc'),
  404. 'col' => '*',
  405. ),
  406. 'getdfCash' => array
  407. (
  408. 'option' => array
  409. (
  410. 'start' => array('yes-t_2.operdate', '>='),
  411. 'end' => array('yes-t_2.operdate', '<='),
  412. 'status' => array('yes-t_1.status', 'in'),
  413. 'state' => 'yes-t_1.state',
  414. ),
  415. 'join' => array
  416. (
  417. array
  418. (
  419. 'table' => 'bill/cash',
  420. 'type' => 'left join',
  421. 'on' => array('cash_id','id'),
  422. 'col' => 't_2.id as cid',
  423. ),
  424. ),
  425. 'type' => 'one',
  426. // 'limit' => '0,5',
  427. // 'order' => array('t_2.sdate' => 'desc','id' => 'desc'),
  428. // 'col' => 'id,t_1.name,t_1.content,t_2.name as company_name',
  429. 'col' => 'id,sum(t_1.cash) as total',
  430. ),
  431. ),
  432. );