user_money.php 9.1 KB

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