yspay_merchant.php 8.9 KB

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