yspay_cash.php 7.8 KB

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