tixian.php 14 KB

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