yspay_tixian.php 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. <?php
  2. $status = array
  3. (
  4. 4 => array('name' => '提现完成', 'style' => 'font-weight:bold;color:green'),
  5. 5 => array('name' => '提现失败', 'style' => 'font-weight:bold;color:#CD3700'),
  6. );
  7. $mid = Dever::input('search_fulltext_mid');
  8. $shop_name = Dever::input('search_api_shop_id');
  9. $shop = array();
  10. if ($shop_name) {
  11. $shop = Dever::db('shop/info')->likeOne(array('name' => $shop_name));
  12. } elseif ($mid) {
  13. $shop = Dever::db('shop/info')->likeOne(array('mid' => $mid));
  14. }
  15. $button = array();
  16. $info = '';
  17. if ($shop) {
  18. # 申请提现和查看提现日志
  19. $account = Dever::db('shop/yspay_account')->find(array('shop_id' => $shop['id']));
  20. $info = $shop['name'] . ',当前余额:' . round($account['cash']/100, 2) . '元,总提现金额:' . round($account['tx_cash']/100, 2) . '元';
  21. if ($shop['type'] == 10) {
  22. $button['手动申请提现'] = array('fast', 1,'yspay_tixian_apply&shop_id=' . $shop['id']);
  23. $button['提现申请记录'] = array('location', 'l=project/database/list&project=shop&table=yspay_tixian_log&search_option_state=1&search_option_shop_id='.$shop['id'].'&oper_table=yspay_tixian&search_fulltext_mid=' . $mid . '&search_api_shop_id=' . $shop_name);
  24. }
  25. }
  26. return array
  27. (
  28. # 表名
  29. 'name' => 'yspay_tixian',
  30. # 显示给用户看的名称
  31. 'lang' => '银联提现列表',
  32. 'order' => -200,
  33. 'info' => $info,
  34. # 数据结构
  35. 'struct' => array
  36. (
  37. 'id' => array
  38. (
  39. 'type' => 'int-11',
  40. 'name' => 'ID',
  41. 'default' => '',
  42. 'desc' => '',
  43. 'match' => 'is_numeric',
  44. 'search' => 'order',
  45. 'update' => 'hidden',
  46. //'list' => true,
  47. ),
  48. 'shop_id' => array
  49. (
  50. 'type' => 'int-11',
  51. 'name' => '门店名称',
  52. 'default' => '',
  53. 'desc' => '所属门店',
  54. 'match' => 'is_numeric',
  55. 'update' => 'text',
  56. 'search' => array
  57. (
  58. 'api' => 'shop/info-like',
  59. 'col' => 'name',
  60. 'result' => 'id',
  61. ),
  62. 'list' => 'Dever::load("shop/info-one#name", {shop_id})',
  63. ),
  64. 'mid' => array
  65. (
  66. 'type' => 'varchar-50',
  67. 'name' => '分账商户号',
  68. 'default' => '',
  69. 'desc' => '分账商户号',
  70. 'match' => 'option',
  71. 'update' => 'text',
  72. 'search' => 'fulltext',
  73. 'list' => true,
  74. ),
  75. 'order_num' => array
  76. (
  77. 'type' => 'varchar-100',
  78. 'name' => '订单号',
  79. 'default' => '',
  80. 'desc' => '订单号',
  81. 'match' => 'is_string',
  82. 'update' => 'text',
  83. 'list' => true,
  84. ),
  85. 'type' => array
  86. (
  87. 'type' => 'varchar-10',
  88. 'name' => '类型',
  89. 'default' => '',
  90. 'desc' => '类型',
  91. 'match' => 'is_numeric',
  92. 'update' => 'text',
  93. ),
  94. 'cash' => array
  95. (
  96. 'type' => 'int-11',
  97. 'name' => '提现金额',
  98. 'default' => '0',
  99. 'desc' => '提现金额',
  100. 'match' => 'option',
  101. 'update' => 'text',
  102. 'list' => 'round({cash}/100, 2)',
  103. ),
  104. 'cardNo' => array
  105. (
  106. 'type' => 'varchar-100',
  107. 'name' => '到账银行卡号',
  108. 'default' => '',
  109. 'desc' => '到账银行卡号',
  110. 'match' => 'is_string',
  111. 'update' => 'text',
  112. //'list' => true,
  113. ),
  114. 'tdate' => array
  115. (
  116. 'type' => 'int-11',
  117. 'name' => '提现到账时间',
  118. 'default' => '',
  119. 'match' => 'is_numeric',
  120. 'desc' => '',
  121. 'search' => 'date',
  122. 'list' => '"{tdate}" ? date("Y-m-d H:i", \'{tdate}\') : "-"',
  123. 'order' => 'desc',
  124. ),
  125. 'status' => array
  126. (
  127. 'type' => 'tinyint-1',
  128. 'name' => '提现状态',
  129. 'default' => '1',
  130. 'desc' => '提现状态',
  131. 'match' => 'is_numeric',
  132. 'option' => $status,
  133. 'search' => 'select',
  134. 'list' => true,
  135. ),
  136. 'state' => array
  137. (
  138. 'type' => 'tinyint-1',
  139. 'name' => '状态',
  140. 'default' => '1',
  141. 'desc' => '请选择状态',
  142. 'match' => 'is_numeric',
  143. ),
  144. 'cdate' => array
  145. (
  146. 'type' => 'int-11',
  147. 'name' => '创建时间',
  148. 'match' => array('is_numeric', time()),
  149. 'desc' => '',
  150. # 只有insert时才生效
  151. //'insert' => true,
  152. //'search' => 'date',
  153. //'list' => 'date("Y-m-d H:i:s", {cdate})',
  154. ),
  155. ),
  156. 'manage' => array
  157. (
  158. 'edit' => false,
  159. 'insert' => false,
  160. 'delete' => false,
  161. 'button' => $button,
  162. ),
  163. 'request' => array
  164. (
  165. 'getTotal' => array
  166. (
  167. 'option' => array
  168. (
  169. 'shop_id' => 'yes',
  170. 'status' => 'yes',
  171. 'state' => 1,
  172. ),
  173. 'type' => 'one',
  174. 'col' => 'sum(cash) as cash',
  175. ),
  176. ),
  177. );