user_money.php 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307
  1. <?php
  2. $status = array
  3. (
  4. 1 => array('name' => '待入账', 'style' => 'font-weight:bold;color:#436EEE'),
  5. 2 => array('name' => '已入账', 'style' => 'font-weight:bold;color:green'),
  6. 3 => array('name' => '已作废', 'style' => 'font-weight:bold;color:#CD3700'),
  7. );
  8. $manage_status = array
  9. (
  10. //1 => '待审核',
  11. 2 => '已审核',
  12. 3 => '已作废',
  13. );
  14. $type = array
  15. (
  16. 1 => '充值',
  17. 2 => '充值返还',
  18. 3 => '邀请奖励',
  19. 4 => '商品退款',
  20. 11 => '提现',
  21. 12 => '购买商品',
  22. );
  23. $excel = false;
  24. $list_button = array();
  25. $list_button['list'] = array('查看详情', '"user_money_sign&project=shop&id={id}&page_type=1&[refer]"');
  26. if (Dever::load('manage/auth')->checkFunc('bill.tixian', 'edit', '审核')) {
  27. $list_button['fast'] = array('审核', '"cash&where_id={id}&col=audit,audit_desc&oper_save_jump=cash&oper_table=cash&oper_parent=cash"', '{status} == 1');
  28. }
  29. $mul = false;
  30. if (Dever::load('manage/auth')->checkFunc('shop.user_money', 'user_money', '批量审核')) {
  31. $mul = '{status} == 1';
  32. }
  33. $button = array();
  34. return array
  35. (
  36. # 表名
  37. 'name' => 'use_money',
  38. # 显示给用户看的名称
  39. 'lang' => '用户资金流水',
  40. 'set' => array
  41. (
  42. 'status' => $status,
  43. 'type' => $type,
  44. ),
  45. 'end' => array
  46. (
  47. 'update' => 'bill/lib/manage.cashAuditUpdate',
  48. 'updatemul' => 'bill/lib/manage.cashAuditUpdate',
  49. ),
  50. 'order' => 99,
  51. # 数据结构
  52. 'struct' => array
  53. (
  54. 'id' => array
  55. (
  56. 'type' => 'int-11',
  57. 'name' => 'ID',
  58. 'default' => '',
  59. 'desc' => '',
  60. 'match' => 'is_numeric',
  61. 'search' => 'order',
  62. //'list' => true,
  63. ),
  64. 'uid' => array
  65. (
  66. 'type' => 'int-11',
  67. 'name' => '用户信息',
  68. 'default' => '-1',
  69. 'desc' => '用户信息',
  70. 'match' => 'is_string',
  71. 'update' => 'text',
  72. 'list' =>'Dever::load("shop/lib/money.showUser", {uid})',
  73. 'list_order' => 2,
  74. ),
  75. 'order_num' => array
  76. (
  77. 'type' => 'varchar-100',
  78. 'name' => '流水号',
  79. 'default' => '',
  80. 'desc' => '流水号',
  81. 'match' => 'is_string',
  82. 'update' => 'text',
  83. 'search' => 'fulltext',
  84. 'list_name' => '流水号<br />交易时间',
  85. 'list' =>'"{order_num}<br />".date(\'Y-m-d H:i\', {cdate})',
  86. 'list_order' => 1,
  87. ),
  88. 'type' => array
  89. (
  90. 'type' => 'int-11',
  91. 'name' => '交易类型',
  92. 'default' => '1',
  93. 'desc' => '交易类型',
  94. 'match' => 'is_numeric',
  95. 'search' => 'select',
  96. 'update' => 'checkbox',
  97. 'option' => $type,
  98. 'list' => true,
  99. 'list_order' => 2,
  100. ),
  101. 'type_id' => array
  102. (
  103. 'type' => 'int-11',
  104. 'name' => '交易来源id',
  105. 'default' => '',
  106. 'desc' => '交易来源id',
  107. 'match' => 'is_string',
  108. 'update' => 'text',
  109. ),
  110. 'cash' => array
  111. (
  112. 'type' => 'decimal-11,2',
  113. 'name' => '金额',
  114. 'default' => '0',
  115. 'desc' => '金额',
  116. 'match' => 'is_numeric',
  117. 'update' => 'text',
  118. 'list_name' => '交易金额<br />账户余额',
  119. 'list' =>'Dever::load("shop/lib/money.getCash", {id})',
  120. 'list_order' => 3,
  121. ),
  122. 'yue' => array
  123. (
  124. 'type' => 'decimal-11,2',
  125. 'name' => '操作后余额',
  126. 'default' => '0',
  127. 'desc' => '操作后余额',
  128. 'match' => 'is_numeric',
  129. 'update' => 'text',
  130. // 'list' => true,
  131. // 'list_order' => 7,
  132. ),
  133. 'status' => array
  134. (
  135. 'type' => 'int-11',
  136. 'name' => '交易状态',
  137. 'default' => '1',
  138. 'desc' => '交易状态',
  139. 'match' => 'is_numeric',
  140. 'update' => 'hidden',
  141. 'option' => $status,
  142. 'search' => 'select',
  143. 'list' => true,
  144. 'list_name' => '交易状态',
  145. 'list_order' => 4,
  146. ),
  147. 'audit' => array
  148. (
  149. 'type' => 'int-11',
  150. 'name' => '审核状态',
  151. 'default' => '2',
  152. 'desc' => '审核状态',
  153. 'match' => 'is_numeric',
  154. 'update' => 'radio',
  155. 'option' => $manage_status,
  156. 'mul' => true,
  157. 'control' => 'audit',
  158. ),
  159. 'audit_desc' => array
  160. (
  161. 'type' => 'varchar-600',
  162. 'name' => '备注',
  163. 'default' => '',
  164. 'desc' => '审核说明',
  165. 'match' => 'is_string',
  166. 'update' => 'textarea',
  167. 'list' => '"{audit_desc}" ? "{audit_desc}" : "-"',
  168. 'list_order' => 5,
  169. 'show' => 'audit=3',
  170. ),
  171. 'desc' => array
  172. (
  173. 'type' => 'varchar-600',
  174. 'name' => '资金说明',
  175. 'default' => '',
  176. 'desc' => '资金说明',
  177. 'match' => 'is_string',
  178. 'update' => 'text',
  179. ),
  180. 'operdate' => array
  181. (
  182. 'type' => 'int-11',
  183. 'name' => '审核确认时间',
  184. 'default' => '',
  185. 'match' => 'is_numeric',
  186. 'desc' => '',
  187. //'list' => '"{operdate}" > 0 ? date("Y-m-d H:i", {operdate}) : "-"',
  188. //'list_order' => 9,
  189. ),
  190. 'state' => array
  191. (
  192. 'type' => 'tinyint-1',
  193. 'name' => '状态',
  194. 'default' => '1',
  195. 'desc' => '请选择状态',
  196. 'match' => 'is_numeric',
  197. ),
  198. 'cdate' => array
  199. (
  200. 'type' => 'int-11',
  201. 'name' => '交易时间',
  202. 'match' => array('is_numeric', time()),
  203. 'desc' => '',
  204. # 只有insert时才生效
  205. 'insert' => true,
  206. 'search' => 'date',
  207. //'list_name' => '交易时间<br />审核时间',
  208. //'list' => 'Dever::load("bill/lib/cash.order_num#num", {id})',
  209. //'list_order' => 20,
  210. ),
  211. ),
  212. 'manage' => array
  213. (
  214. 'insert' => false,
  215. 'delete' => false,
  216. 'edit' => false,
  217. //'excel' => $excel,
  218. 'button' => $button,
  219. 'mul' => $mul,
  220. 'list_button' => $list_button,
  221. ),
  222. 'request' => array
  223. (
  224. 'getData' => array
  225. (
  226. # 匹配的正则或函数 选填项
  227. 'option' => array
  228. (
  229. 'start' => array('yes-cdate', '>='),
  230. 'end' => array('yes-cdate', '<='),
  231. 'uid' => 'yes',
  232. 'type' => 'yes',
  233. 'state' => 1,
  234. ),
  235. 'order' => array('id' => 'desc'),
  236. 'page' => array(10, 'list'),
  237. 'type' => 'all',
  238. 'col' => '*',
  239. ),
  240. # 获取订单数量
  241. 'getCash' => array
  242. (
  243. # 匹配的正则或函数 选填项
  244. 'option' => array
  245. (
  246. 'start' => array('yes-cdate', '>='),
  247. 'end' => array('yes-cdate', '<='),
  248. 'type' => array('yes', 'in'),
  249. 'uid' => 'yes',
  250. 'status' => 2,
  251. 'state' => 1,
  252. ),
  253. 'type' => 'one',
  254. 'col' => 'sum(cash) as total',
  255. ),
  256. 'getwsCash' => array
  257. (
  258. # 匹配的正则或函数 选填项
  259. 'option' => array
  260. (
  261. 'start' => array('yes-cdate', '>='),
  262. 'end' => array('yes-cdate', '<='),
  263. 'status' => array('yes', 'in'),
  264. 'uid' => array('yes', 'in'),
  265. 'mid' => 'yes',
  266. 'state' => 1,
  267. ),
  268. 'type' => 'one',
  269. 'col' => 'sum(cash) as total',
  270. ),
  271. 'getExcelAll' => array
  272. (
  273. # 匹配的正则或函数 选填项
  274. 'option' => array
  275. (
  276. 'start' => array('yes-cdate', '>='),
  277. 'end' => array('yes-cdate', '<='),
  278. 'state' => 1,
  279. ),
  280. 'type' => 'all',
  281. 'col' => '*',
  282. ),
  283. ),
  284. );