yspay_merchant.php 9.3 KB

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