yspay_merchant.php 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296
  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. 'control' => 'type',
  73. ),
  74. 'project_id' => array
  75. (
  76. 'type' => 'int-11',
  77. 'name' => '所属项目',
  78. 'default' => '',
  79. 'desc' => '所属项目',
  80. 'match' => 'option',
  81. 'search' => 'select',
  82. 'update' => 'radio',
  83. 'control_url' => 'pay/yspay/merchant.selectRelate',
  84. 'option' => $project,
  85. //'list' => true,
  86. 'show' => 'type=1',
  87. ),
  88. 'relate_id' => array
  89. (
  90. 'type' => 'int-11',
  91. 'name' => '关联数据',
  92. 'default' => '-1',
  93. 'desc' => '关联数据',
  94. 'match' => 'option',
  95. 'update' => 'select',
  96. 'show' => 'type=1',
  97. ),
  98. 'mid' => array
  99. (
  100. 'type' => 'varchar-200',
  101. 'name' => '商户号',
  102. 'default' => '',
  103. 'desc' => '商户号',
  104. 'match' => 'option',
  105. 'search' => 'fulltext',
  106. 'update' => 'text',
  107. 'list' => true,
  108. ),
  109. 'merno' => array
  110. (
  111. 'type' => 'varchar-200',
  112. 'name' => '企业用户号-清分时使用',
  113. 'default' => '',
  114. 'desc' => '企业用户号',
  115. 'match' => 'option',
  116. 'update' => 'text',
  117. ),
  118. 'cash_per' => array
  119. (
  120. 'type' => 'int-11',
  121. 'name' => '平台分账百分比-如输入10,就是从总支付金额中分账10%,未输入则直接使用默认分账百分比',
  122. 'default' => '',
  123. 'desc' => '平台分账百分比',
  124. 'match' => 'option',
  125. 'update' => 'text',
  126. ),
  127. 'cash' => array
  128. (
  129. 'type' => 'int-11',
  130. 'name' => '资金总额',
  131. 'default' => '0',
  132. 'desc' => '资金总额',
  133. 'match' => 'option',
  134. //'update' => 'text',
  135. 'list_name' => '资金总额 / 划付总额 / 分账总额',
  136. 'list' => 'Dever::number({cash}/100, 2) . " / " . Dever::number({hf_cash}/100, 2) . " / " . Dever::number({fz_cash}/100, 2)',
  137. ),
  138. 'hf_cash' => array
  139. (
  140. 'type' => 'int-11',
  141. 'name' => '划付总额-划付就是提现到商户自己账户的意思',
  142. 'default' => '0',
  143. 'desc' => '划付总额',
  144. 'match' => 'option',
  145. //'update' => 'text',
  146. //'list' => 'Dever::number({hf_cash}/100, 2)',
  147. ),
  148. 'fz_cash' => array
  149. (
  150. 'type' => 'int-11',
  151. 'name' => '分账总额',
  152. 'default' => '0',
  153. 'desc' => '分账总额',
  154. 'match' => 'option',
  155. //'update' => 'text',
  156. //'list' => 'Dever::number({fz_cash}/100, 2)',
  157. ),
  158. 'yue' => array
  159. (
  160. 'type' => 'int-11',
  161. 'name' => '账户余额',
  162. 'default' => '0',
  163. 'desc' => '账户余额',
  164. 'match' => 'option',
  165. //'update' => 'text',
  166. 'list_name' => '账户余额 / 提现总额',
  167. 'list' => 'Dever::number({yue}/100, 2) . " / " . Dever::number({tx_cash}/100, 2)',
  168. ),
  169. 'tx_cash' => array
  170. (
  171. 'type' => 'int-11',
  172. 'name' => '提现总额',
  173. 'default' => '0',
  174. 'desc' => '划付总额',
  175. 'match' => 'option',
  176. //'update' => 'text',
  177. //'list' => 'Dever::number({tx_cash}/100, 2)',
  178. ),
  179. 'pay/yspay_sign-one#step'=> array
  180. (
  181. 'name' => '当前状态',
  182. 'default' => '',
  183. 'desc' => '当前状态',
  184. 'match' => 'option',
  185. # 读取另外表的关联方式
  186. 'sync' => array('merchant_id' => 'id'),
  187. ),
  188. 'status' => array
  189. (
  190. 'type' => 'tinyint-11',
  191. 'name' => '状态',
  192. 'default' => '2',
  193. 'desc' => '状态',
  194. 'match' => 'option',
  195. 'option' => $status,
  196. 'update' => 'radio',
  197. 'search' => 'select',
  198. //'list' => true,
  199. ),
  200. 'state' => array
  201. (
  202. 'type' => 'tinyint-1',
  203. 'name' => '状态',
  204. 'default' => '1',
  205. 'desc' => '请选择状态',
  206. 'match' => 'is_numeric',
  207. 'list_name' => '签约进度',
  208. 'list' => 'Dever::load("pay/yspay/sign.getLog", {id}, {status})',
  209. ),
  210. 'cdate' => array
  211. (
  212. 'type' => 'int-11',
  213. 'name' => '录入时间',
  214. 'match' => array('is_numeric', time()),
  215. 'desc' => '',
  216. # 只有insert时才生效
  217. 'insert' => true,
  218. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  219. ),
  220. ),
  221. 'manage' => array
  222. (
  223. 'insert' => false,
  224. 'edit' => false,
  225. # 自定义快捷新增和编辑
  226. 'button' => array
  227. (
  228. '新增' => array('fast'),
  229. ),
  230. 'list_button' => array
  231. (
  232. 'edit' => array('编辑'),
  233. 'add' => array('签约资料', '"yspay_sign&search_option_merchant_id={id}&where_id={id}&oper_table=account&oper_save_table=yspay_merchant"', '{status} == 2'),
  234. 'oper' => array('签约提审', 'pay/yspay/sign.handle?sign_id={id}', '"{pay/yspay_sign-one#step}" == -1 && {status} == 2'),
  235. 'fast' => array('签约打款', '"yspay_sign&where_id={id}&col=cash"', '"{pay/yspay_sign-one#step}" == 2 && {status} == 2'),
  236. 'copy' => array('签约合同', 'pay/yspay/sign.getAgreement?sign_id={id}', '"{pay/yspay_sign-one#step}" == 4 && {status} == 2'),
  237. 'list' => array('资金流水', '"yspay_cash&search_option_merchant_id={id}&oper_table=yspay_merchant&top_table=account"', '{status} == 1'),
  238. 'list2' => array('提现管理', '"yspay_tixian&search_option_merchant_id={id}&oper_table=yspay_merchant&top_table=account"', '{status} == 1'),
  239. 'list1' => array('签约日志', '"yspay_sign_log&search_option_merchant_id={id}&oper_table=yspay_merchant&top_table=account"'),
  240. ),
  241. ),
  242. 'request' => array
  243. (
  244. 'tx_inc' => array
  245. (
  246. 'type' => 'update',
  247. 'where' => array
  248. (
  249. 'id' => 'yes',
  250. ),
  251. 'set' => array
  252. (
  253. 'tx_cash' => array('yes', '+='),
  254. ),
  255. ),
  256. 'dec' => array
  257. (
  258. 'type' => 'update',
  259. 'where' => array
  260. (
  261. 'id' => 'yes',
  262. ),
  263. 'set' => array
  264. (
  265. 'yue' => array('yes', '-='),
  266. ),
  267. ),
  268. )
  269. );