yspay_merchant.php 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264
  1. <?php
  2. $status = array
  3. (
  4. 1 => '已签约',
  5. 2 => '未签约',
  6. );
  7. $project = function()
  8. {
  9. return Dever::db('pay/yspay_project')->state();
  10. };
  11. return array
  12. (
  13. # 表名
  14. 'name' => 'yspay_merchant',
  15. # 显示给用户看的名称
  16. 'lang' => '银联商户列表',
  17. # 后台菜单排序
  18. 'order' => -100,
  19. 'check' => 'mid',
  20. 'menu' => false,
  21. # 数据结构
  22. 'struct' => array
  23. (
  24. 'id' => array
  25. (
  26. 'type' => 'int-11',
  27. 'name' => 'ID',
  28. 'default' => '',
  29. 'desc' => '',
  30. 'match' => 'is_numeric',
  31. 'search' => 'order',
  32. //'list' => true,
  33. 'order' => 'desc',
  34. ),
  35. 'account_id' => array
  36. (
  37. 'type' => 'int-11',
  38. 'name' => '账户id',
  39. 'default' => '',
  40. 'desc' => '账户id',
  41. 'match' => 'option',
  42. 'update' => 'hidden',
  43. 'value' => Dever::input('search_option_account_id'),
  44. ),
  45. 'name' => array
  46. (
  47. 'type' => 'varchar-300',
  48. 'name' => '商户名称',
  49. 'default' => '',
  50. 'desc' => '商户名称',
  51. 'match' => 'is_string',
  52. 'update' => 'text',
  53. 'search' => 'fulltext',
  54. 'list' => true,
  55. ),
  56. 'project_id' => array
  57. (
  58. 'type' => 'varchar-500',
  59. 'name' => '所属项目',
  60. 'default' => '',
  61. 'desc' => '所属项目',
  62. 'match' => 'option',
  63. 'search' => 'select',
  64. 'update' => 'radio',
  65. 'control_url' => 'pay/yspay/merchant.selectRelate',
  66. 'option' => $project,
  67. 'list' => true,
  68. ),
  69. 'relate_id' => array
  70. (
  71. 'type' => 'int-11',
  72. 'name' => '关联数据',
  73. 'default' => '1',
  74. 'desc' => '关联数据',
  75. 'match' => 'option',
  76. 'update' => 'select',
  77. ),
  78. 'mid' => array
  79. (
  80. 'type' => 'varchar-200',
  81. 'name' => '商户号',
  82. 'default' => '',
  83. 'desc' => '商户号',
  84. 'match' => 'option',
  85. 'update' => 'text',
  86. 'list' => true,
  87. ),
  88. 'per' => array
  89. (
  90. 'type' => 'int-11',
  91. 'name' => '平台分账百分比-如输入10,就是从总支付金额中分账10%,未输入则直接使用默认分账百分比',
  92. 'default' => '',
  93. 'desc' => '平台分账百分比',
  94. 'match' => 'option',
  95. 'update' => 'text',
  96. ),
  97. 'cash' => array
  98. (
  99. 'type' => 'int-11',
  100. 'name' => '资金总额',
  101. 'default' => '0',
  102. 'desc' => '资金总额',
  103. 'match' => 'option',
  104. //'update' => 'text',
  105. 'list_name' => '资金总额 / 划付总额 / 分账总额',
  106. 'list' => 'Dever::number({cash}/100, 2) . " / " . Dever::number({hf_cash}/100, 2) . " / " . Dever::number({fz_cash}/100, 2)',
  107. ),
  108. 'hf_cash' => array
  109. (
  110. 'type' => 'int-11',
  111. 'name' => '划付总额-划付就是提现到商户自己账户的意思',
  112. 'default' => '0',
  113. 'desc' => '划付总额',
  114. 'match' => 'option',
  115. //'update' => 'text',
  116. //'list' => 'round({hf_cash}/100, 2)',
  117. ),
  118. 'fz_cash' => array
  119. (
  120. 'type' => 'int-11',
  121. 'name' => '分账总额',
  122. 'default' => '0',
  123. 'desc' => '分账总额',
  124. 'match' => 'option',
  125. //'update' => 'text',
  126. //'list' => 'round({fz_cash}/100, 2)',
  127. ),
  128. 'yue' => array
  129. (
  130. 'type' => 'int-11',
  131. 'name' => '账户余额',
  132. 'default' => '0',
  133. 'desc' => '账户余额',
  134. 'match' => 'option',
  135. //'update' => 'text',
  136. 'list_name' => '账户余额 / 提现总额',
  137. 'list' => 'Dever::number({yue}/100, 2) . " / " . Dever::number({tx_cash}/100, 2)',
  138. ),
  139. 'tx_cash' => array
  140. (
  141. 'type' => 'int-11',
  142. 'name' => '提现总额',
  143. 'default' => '0',
  144. 'desc' => '划付总额',
  145. 'match' => 'option',
  146. //'update' => 'text',
  147. //'list' => 'round({tx_cash}/100, 2)',
  148. ),
  149. 'pay/yspay_sign-one#step'=> array
  150. (
  151. 'name' => '当前状态',
  152. 'default' => '',
  153. 'desc' => '当前状态',
  154. 'match' => 'option',
  155. # 读取另外表的关联方式
  156. 'sync' => array('merchant_id' => 'id'),
  157. ),
  158. 'status' => array
  159. (
  160. 'type' => 'tinyint-11',
  161. 'name' => '状态',
  162. 'default' => '2',
  163. 'desc' => '状态',
  164. 'match' => 'option',
  165. 'option' => $status,
  166. 'update' => 'radio',
  167. 'search' => 'select',
  168. //'list' => true,
  169. ),
  170. 'state' => array
  171. (
  172. 'type' => 'tinyint-1',
  173. 'name' => '状态',
  174. 'default' => '1',
  175. 'desc' => '请选择状态',
  176. 'match' => 'is_numeric',
  177. 'list_name' => '签约进度',
  178. 'list' => 'Dever::load("pay/yspay/sign.getLog", {id}, {status})',
  179. ),
  180. 'cdate' => array
  181. (
  182. 'type' => 'int-11',
  183. 'name' => '录入时间',
  184. 'match' => array('is_numeric', time()),
  185. 'desc' => '',
  186. # 只有insert时才生效
  187. 'insert' => true,
  188. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  189. ),
  190. ),
  191. 'manage' => array
  192. (
  193. 'insert' => false,
  194. 'edit' => false,
  195. # 自定义快捷新增和编辑
  196. 'button' => array
  197. (
  198. '新增' => array('fast'),
  199. ),
  200. 'list_button' => array
  201. (
  202. 'edit' => array('编辑'),
  203. 'add' => array('签约', '"yspay_sign&search_option_merchant_id={id}&where_id={id}&oper_table=account&oper_save_table=yspay_merchant"', '{status} == 2'),
  204. 'oper' => array('提交资料', 'pay/yspay/sign.handle?sign_id={id}', '{pay/yspay_sign-one#step} == -1 && {status} == 2'),
  205. 'fast' => array('打款确认', '"yspay_sign&where_id={id}&col=cash"', '{pay/yspay_sign-one#step} == 2 && {status} == 2'),
  206. 'copy' => array('合同链接', 'pay/yspay/sign.getAgreement?sign_id={id}', '{pay/yspay_sign-one#step} == 4 && {status} == 2'),
  207. 'list' => array('资金流水', '"yspay_cash&search_option_merchant_id={id}&oper_table=yspay_merchant&top_table=account"', '{status} == 1'),
  208. 'list2' => array('提现管理', '"yspay_tixian&search_option_merchant_id={id}&oper_table=yspay_merchant&top_table=account"', '{status} == 1'),
  209. 'list1' => array('签约日志', '"yspay_sign_log&search_option_merchant_id={id}&oper_table=yspay_merchant&top_table=account"'),
  210. ),
  211. ),
  212. 'request' => array
  213. (
  214. 'tx_inc' => array
  215. (
  216. 'type' => 'update',
  217. 'where' => array
  218. (
  219. 'id' => 'yes',
  220. ),
  221. 'set' => array
  222. (
  223. 'tx_cash' => array('yes', '+='),
  224. ),
  225. ),
  226. 'dec' => array
  227. (
  228. 'type' => 'update',
  229. 'where' => array
  230. (
  231. 'id' => 'yes',
  232. ),
  233. 'set' => array
  234. (
  235. 'yue' => array('yes', '-='),
  236. ),
  237. ),
  238. )
  239. );