yspay_cash.php 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  1. <?php
  2. $status = array
  3. (
  4. 1 => '未确认',
  5. 2 => '已确认',
  6. );
  7. $fenzhang_status = array
  8. (
  9. 1 => '未分账',
  10. 2 => '已分账',
  11. 3 => '分账失败',
  12. );
  13. $button = array();
  14. $merchant_id = Dever::input('search_option_merchant_id');
  15. $info = '';
  16. if ($merchant_id) {
  17. $merchant = Dever::db('pay/yspay_merchant')->one($merchant_id);
  18. $yue = $merchant['hf_cash'] - $merchant['hf_tx_cash'];
  19. $yue = $yue/100;
  20. $beifujin = 0;
  21. if ($yue >= 100) {
  22. $beifujin = 100;
  23. }
  24. $tixian = $yue - $beifujin;
  25. $info = '当前账户余额:¥' . Dever::number($yue) . '&nbsp;&nbsp;&nbsp;&nbsp;备付金:¥'.Dever::number($beifujin).'&nbsp;&nbsp;&nbsp;&nbsp;可提现余额:¥' . Dever::number($tixian);
  26. if (Dever::load('manage/auth')->checkFunc('pay.account', 'huafu', '账户提现')) {
  27. $button = array
  28. (
  29. '账户提现' => array('fast', '', 'yspay_cash_tixian&search_option_merchant_id=' . $merchant_id),
  30. );
  31. }
  32. }
  33. return array
  34. (
  35. # 表名
  36. 'name' => 'yspay_cash',
  37. # 显示给用户看的名称
  38. 'lang' => '银联资金记录表',
  39. 'menu' => false,
  40. 'info' => $info,
  41. # 数据结构
  42. 'struct' => array
  43. (
  44. 'id' => array
  45. (
  46. 'type' => 'int-11',
  47. 'name' => 'ID',
  48. 'default' => '',
  49. 'desc' => '',
  50. 'match' => 'is_numeric',
  51. 'search' => 'order',
  52. 'update' => 'hidden',
  53. //'list' => true,
  54. ),
  55. 'account_id' => array
  56. (
  57. 'type' => 'int-11',
  58. 'name' => '账户id',
  59. 'default' => '',
  60. 'desc' => '账户id',
  61. 'match' => 'option',
  62. 'search' => 'hidden',
  63. 'update' => 'hidden',
  64. 'value' => Dever::input('search_option_account_id'),
  65. ),
  66. 'merchant_id' => array
  67. (
  68. 'type' => 'int-11',
  69. 'name' => '商户id',
  70. 'default' => '',
  71. 'desc' => '商户id',
  72. 'match' => 'option',
  73. 'search' => 'hidden',
  74. 'update' => 'hidden',
  75. 'value' => $merchant_id,
  76. 'list_name' => '商户名称',
  77. 'list' => 'Dever::load("pay/yspay_merchant-one#name", "{merchant_id}")',
  78. ),
  79. 'order_num' => array
  80. (
  81. 'type' => 'varchar-800',
  82. 'name' => '流水号',
  83. 'default' => '',
  84. 'desc' => '流水号',
  85. 'match' => 'is_string',
  86. 'update' => 'text',
  87. 'search' => 'fulltext',
  88. 'list' => true,
  89. ),
  90. 'source_order_num' => array
  91. (
  92. 'type' => 'varchar-800',
  93. 'name' => '关联订单号',
  94. 'default' => '',
  95. 'desc' => '关联订单号',
  96. 'match' => 'is_string',
  97. 'update' => 'text',
  98. 'search' => 'fulltext',
  99. 'list' => true,
  100. ),
  101. 'ycash' => array
  102. (
  103. 'type' => 'int-11',
  104. 'name' => '交易金额',
  105. 'default' => '0',
  106. 'desc' => '交易金额',
  107. 'match' => 'option',
  108. 'list' => 'Dever::number({ycash}/100, 2)',
  109. ),
  110. 'yl_cash' => array
  111. (
  112. 'type' => 'int-11',
  113. 'name' => '银联手续费',
  114. 'default' => '0',
  115. 'desc' => '银联手续费',
  116. 'match' => 'option',
  117. 'list' => 'Dever::number({yl_cash}/100, 2)',
  118. ),
  119. 'pt_cash' => array
  120. (
  121. 'type' => 'int-11',
  122. 'name' => '平台手续费',
  123. 'default' => '0',
  124. 'desc' => '平台手续费',
  125. 'match' => 'option',
  126. 'list' => 'Dever::number({pt_cash}/100, 2)',
  127. ),
  128. 'cash' => array
  129. (
  130. 'type' => 'int-11',
  131. 'name' => '实际金额',
  132. 'default' => '0',
  133. 'desc' => '实际金额',
  134. 'match' => 'option',
  135. 'list' => 'Dever::number({cash}/100, 2)',
  136. ),
  137. 'hf_cash' => array
  138. (
  139. 'type' => 'int-11',
  140. 'name' => '商户划付金额',
  141. 'default' => '0',
  142. 'desc' => '划付金额',
  143. 'match' => 'option',
  144. //'update' => 'text',
  145. 'list' => 'Dever::number({hf_cash}/100, 2)',
  146. ),
  147. 'fz_cash' => array
  148. (
  149. 'type' => 'int-11',
  150. 'name' => '平台分账金额',
  151. 'default' => '0',
  152. 'desc' => '分账金额',
  153. 'match' => 'option',
  154. //'update' => 'text',
  155. 'list' => 'Dever::number({fz_cash}/100, 2)',
  156. ),
  157. 'rdate' => array
  158. (
  159. 'type' => 'int-11',
  160. 'name' => '分账时间',
  161. 'default' => '',
  162. 'match' => 'is_numeric',
  163. 'desc' => '',
  164. 'search' => 'date',
  165. 'list' => '"{rdate}" ? date("Y-m-d H:i", \'{rdate}\') : "-"',
  166. 'list_order' => 100,
  167. ),
  168. 'tdate' => array
  169. (
  170. 'type' => 'int-11',
  171. 'name' => '提现时间',
  172. 'default' => '',
  173. 'match' => 'is_numeric',
  174. 'desc' => '',
  175. //'search' => 'date',
  176. //'list' => '"{tdate}" ? date("Y-m-d H:i", \'{tdate}\') : "-"',
  177. //'list_order' => 101,
  178. ),
  179. 'status' => array
  180. (
  181. 'type' => 'tinyint-1',
  182. 'name' => '订单状态',
  183. 'default' => '1',
  184. 'desc' => '订单状态',
  185. 'match' => 'is_numeric',
  186. 'option' => $status,
  187. 'search' => 'select',
  188. 'list' => true,
  189. ),
  190. 'fenzhang_status' => array
  191. (
  192. 'type' => 'tinyint-1',
  193. 'name' => '分账状态',
  194. 'default' => '1',
  195. 'desc' => '分账状态',
  196. 'match' => 'is_numeric',
  197. 'option' => $fenzhang_status,
  198. 'search' => 'select',
  199. 'list' => true,
  200. ),
  201. 'state' => array
  202. (
  203. 'type' => 'tinyint-1',
  204. 'name' => '状态',
  205. 'default' => '1',
  206. 'desc' => '请选择状态',
  207. 'match' => 'is_numeric',
  208. ),
  209. 'cdate' => array
  210. (
  211. 'type' => 'int-11',
  212. 'name' => '下单时间',
  213. 'match' => array('is_numeric', time()),
  214. 'desc' => '',
  215. # 只有insert时才生效
  216. //'insert' => true,
  217. 'search' => 'date',
  218. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  219. ),
  220. ),
  221. 'manage' => array
  222. (
  223. 'edit' => false,
  224. 'insert' => false,
  225. 'delete' => false,
  226. 'button' => $button,
  227. ),
  228. 'request' => array
  229. (
  230. 'getTotal' => array
  231. (
  232. 'option' => array
  233. (
  234. 'merchant_id' => 'yes',
  235. 'status' => array('yes', '>='),
  236. 'state' => 1,
  237. ),
  238. 'type' => 'one',
  239. 'col' => 'sum(cash) as cash,sum(hf_cash) as hf_cash,sum(fz_cash) as fz_cash,sum(yl_cash) as yl_cash,sum(pt_cash) as pt_cash',
  240. ),
  241. ),
  242. );