account.php 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341
  1. <?php
  2. $type = Dever::config('base', 'pay')->pay['type'];
  3. $system_source = Dever::config('base')->system_source;
  4. $channel = function()
  5. {
  6. return Dever::db('pay/channel')->state();
  7. };
  8. $box = array
  9. (
  10. 1 => '正式环境',
  11. 2 => '沙箱模式',
  12. 3 => '测试环境',
  13. );
  14. return array
  15. (
  16. # 表名
  17. 'name' => 'account',
  18. # 显示给用户看的名称
  19. 'lang' => '账户管理',
  20. 'order' => 10,
  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. ),
  34. 'name' => array
  35. (
  36. 'type' => 'varchar-60',
  37. 'name' => '账户名称',
  38. 'default' => '',
  39. 'desc' => '账户名称',
  40. 'match' => 'is_string',
  41. 'update' => 'text',
  42. 'search' => 'fulltext',
  43. 'list' => true,
  44. ),
  45. 'type' => array
  46. (
  47. 'type' => 'varchar-30',
  48. 'name' => '支付类型',
  49. 'default' => 'wechat',
  50. 'desc' => '支付类型',
  51. 'match' => 'is_string',
  52. 'update' => 'radio',
  53. 'option' => $type,
  54. 'search' => 'select',
  55. 'list' => true,
  56. 'control' => 'type',
  57. ),
  58. 'box' => array
  59. (
  60. 'type' => 'int-11',
  61. 'name' => '支付环境-沙箱模式为支付时第三方平台不实际收费,测试环境为不拉取第三方支付',
  62. 'default' => '1',
  63. 'desc' => '支付环境',
  64. 'match' => 'is_numeric',
  65. 'update' => 'radio',
  66. 'option' => $box,
  67. 'show' => 'alipay',
  68. ),
  69. 'system_source' => array
  70. (
  71. 'type' => 'tinyint-1',
  72. 'name' => '所属平台',
  73. 'default' => '1',
  74. 'desc' => '所属平台',
  75. 'match' => 'is_numeric',
  76. 'update' => 'radio',
  77. 'option' => $system_source,
  78. 'search' => 'select',
  79. 'list' => true,
  80. ),
  81. 'channel_id' => array
  82. (
  83. 'type' => 'int-11',
  84. 'name' => '所属渠道',
  85. 'default' => '1',
  86. 'desc' => '所属渠道',
  87. 'match' => 'is_numeric',
  88. 'update' => 'radio',
  89. 'option' => $channel,
  90. 'search' => 'select',
  91. 'list' => true,
  92. ),
  93. 'mchid' => array
  94. (
  95. 'type' => 'varchar-150',
  96. 'name' => '商户号',
  97. 'default' => '',
  98. 'desc' => '商户号',
  99. 'match' => 'is_string',
  100. 'update' => 'text',
  101. ),
  102. 'key' => array
  103. (
  104. 'type' => 'varchar-150',
  105. 'name' => '密匙key',
  106. 'default' => '',
  107. 'desc' => '密匙key',
  108. 'match' => 'is_string',
  109. 'update' => 'text',
  110. ),
  111. 'appid' => array
  112. (
  113. 'type' => 'varchar-150',
  114. 'name' => 'appid',
  115. 'default' => '',
  116. 'desc' => 'appid',
  117. 'match' => 'is_string',
  118. 'update' => 'text',
  119. 'show' => 'type=wechat,cmbc,alipay,yspay,yspaym',
  120. ),
  121. 'appsecret' => array
  122. (
  123. 'type' => 'varchar-300',
  124. 'name' => 'appsecret',
  125. 'default' => '',
  126. 'desc' => 'appsecret',
  127. 'match' => 'is_string',
  128. 'update' => 'text',
  129. 'show' => 'type=wechat,cmbc,yspay,yspaym',
  130. ),
  131. 'account' => array
  132. (
  133. 'type' => 'varchar-150',
  134. 'name' => '支付账号',
  135. 'default' => '',
  136. 'desc' => '支付账号',
  137. 'match' => 'is_string',
  138. 'update' => 'text',
  139. 'show' => 'type=alipay',
  140. ),
  141. 'private_key' => array
  142. (
  143. 'type' => 'text-255',
  144. 'name' => '商户私钥-https://doc.open.alipay.com/doc2/detail.htm?spm=a219a.7629140.0.0.nBDxfy&treeId=58&articleId=103242&docType=1',
  145. 'default' => '',
  146. 'desc' => '商户私钥',
  147. 'match' => 'is_string',
  148. 'update' => 'textarea',
  149. 'show' => 'type=alipay',
  150. ),
  151. 'm_public_key' => array
  152. (
  153. 'type' => 'varchar-1000',
  154. 'name' => '商户公钥-https://b.alipay.com/order/pidAndKey.htm',
  155. 'default' => '',
  156. 'desc' => '商户公钥',
  157. 'match' => 'is_string',
  158. 'update' => 'textarea',
  159. 'show' => 'type=alipay',
  160. ),
  161. 'public_key' => array
  162. (
  163. 'type' => 'varchar-1000',
  164. 'name' => '支付宝公钥-https://b.alipay.com/order/pidAndKey.htm',
  165. 'default' => '',
  166. 'desc' => '支付宝公钥',
  167. 'match' => 'is_string',
  168. 'update' => 'textarea',
  169. 'show' => 'type=alipay',
  170. ),
  171. 'appCertPath' => array
  172. (
  173. 'type' => 'varchar-150',
  174. 'name' => '支付宝appCertPath',
  175. 'default' => '',
  176. 'desc' => '证书cert文件',
  177. 'match' => 'option',
  178. 'update' => 'upload',
  179. 'key' => '4',
  180. 'show' => 'type=alipay',
  181. ),
  182. 'alipayCertPath' => array
  183. (
  184. 'type' => 'varchar-150',
  185. 'name' => '支付宝alipayCertPath',
  186. 'default' => '',
  187. 'desc' => '证书key文件',
  188. 'match' => 'option',
  189. 'update' => 'upload',
  190. 'key' => '4',
  191. 'show' => 'type=alipay',
  192. ),
  193. 'rootCertPath' => array
  194. (
  195. 'type' => 'varchar-150',
  196. 'name' => '支付宝rootCertPath',
  197. 'default' => '',
  198. 'desc' => '证书key文件',
  199. 'match' => 'option',
  200. 'update' => 'upload',
  201. 'key' => '4',
  202. 'show' => 'type=alipay',
  203. ),
  204. 'file_cert' => array
  205. (
  206. 'type' => 'varchar-150',
  207. 'name' => '证书cert文件',
  208. 'default' => '',
  209. 'desc' => '证书cert文件',
  210. 'match' => 'option',
  211. 'update' => 'upload',
  212. 'key' => '4',
  213. 'show' => 'type=wechat',
  214. ),
  215. 'file_key' => array
  216. (
  217. 'type' => 'varchar-150',
  218. 'name' => '证书key文件',
  219. 'default' => '',
  220. 'desc' => '证书key文件',
  221. 'match' => 'option',
  222. 'update' => 'upload',
  223. 'key' => '4',
  224. 'show' => 'type=wechat',
  225. ),
  226. 'timeout' => array
  227. (
  228. 'type' => 'int-11',
  229. 'name' => '支付有效期-秒',
  230. 'default' => '600',
  231. 'desc' => '支付有效期',
  232. 'match' => 'is_numeric',
  233. 'update' => 'text',
  234. ),
  235. 'pay/yspay' => array
  236. (
  237. 'name' => '银商扩展设置',
  238. 'default' => '',
  239. 'desc' => '银商扩展设置',
  240. 'match' => 'option',
  241. # 同步更新另外一个表的内容,另外一个表的字段=>本表的字段
  242. 'sync' => array('account_id' => 'id'),
  243. 'update' => array(1),
  244. 'option' => array('默认配置'),
  245. # 1纵向展示 2横向展示
  246. 'update_type' => 1,
  247. 'show' => 'type=yspay',
  248. ),
  249. 'pay/yspay_project' => array
  250. (
  251. 'name' => '关联项目',
  252. 'default' => '',
  253. 'desc' => '关联项目',
  254. 'match' => 'option',
  255. 'sync' => array('account_id' => 'id'),
  256. 'update_type' => 2,
  257. 'update' => array(1),
  258. 'show' => 'type=yspay',
  259. ),
  260. 'state' => array
  261. (
  262. 'type' => 'tinyint-1',
  263. 'name' => '状态',
  264. 'default' => '1',
  265. 'desc' => '请选择状态',
  266. 'match' => 'is_numeric',
  267. ),
  268. 'cdate' => array
  269. (
  270. 'type' => 'int-11',
  271. 'name' => '申请时间',
  272. 'match' => array('is_numeric', time()),
  273. 'desc' => '',
  274. # 只有insert时才生效
  275. 'insert' => true,
  276. 'search' => 'date',
  277. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  278. ),
  279. ),
  280. 'manage' => array
  281. (
  282. # 自定义快捷新增和编辑
  283. 'button' => array
  284. (
  285. '渠道管理' => array('list', 'channel&project=pay&oper_parent=account&oper_project=pay'),
  286. ),
  287. 'list_button' => array
  288. (
  289. 'list' => array('主体列表', '"yspay_main&search_option_account_id={id}&parent=account"', '"{type}" == "yspay"'),
  290. //'list' => array('商户列表', '"yspay_merchant&search_option_account_id={id}&oper_table=account"', '"{type}" == "yspay"'),
  291. //'list1' => array('资管', '"yspay_sign&search_option_account_id={id}&oper_table=account"', '"{type}" == "yspay"'),
  292. ),
  293. ),
  294. # 默认值
  295. 'default' => array
  296. (
  297. 'col' => 'name,system_source,type,state,cdate',
  298. 'value' => array
  299. (
  300. '"h5支付",1,"wechat",1,' . time(),
  301. '"安卓支付",2,"wechat",1,' . time(),
  302. '"苹果支付",3,"wechat",1,' . time(),
  303. '"微信二维码支付",4,"wechat",1,' . time(),
  304. '"微信小程序支付",5,"wechat",1,' . time(),
  305. '"微信公众号支付",6,"wechat",1,' . time(),
  306. ),
  307. ),
  308. );