account.php 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300
  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. );
  13. return array
  14. (
  15. # 表名
  16. 'name' => 'account',
  17. # 显示给用户看的名称
  18. 'lang' => '账户管理',
  19. 'order' => 10,
  20. # 数据结构
  21. 'struct' => array
  22. (
  23. 'id' => array
  24. (
  25. 'type' => 'int-11',
  26. 'name' => 'ID',
  27. 'default' => '',
  28. 'desc' => '',
  29. 'match' => 'is_numeric',
  30. 'search' => 'order',
  31. 'list' => true,
  32. ),
  33. 'name' => array
  34. (
  35. 'type' => 'varchar-60',
  36. 'name' => '账户名称',
  37. 'default' => '',
  38. 'desc' => '账户名称',
  39. 'match' => 'is_string',
  40. 'update' => 'text',
  41. 'search' => 'fulltext',
  42. 'list' => true,
  43. ),
  44. 'type' => array
  45. (
  46. 'type' => 'varchar-30',
  47. 'name' => '支付类型',
  48. 'default' => 'wechat',
  49. 'desc' => '支付类型',
  50. 'match' => 'is_string',
  51. 'update' => 'radio',
  52. 'option' => $type,
  53. 'search' => 'select',
  54. 'list' => true,
  55. 'control' => 'type',
  56. ),
  57. 'box' => array
  58. (
  59. 'type' => 'int-11',
  60. 'name' => '支付环境',
  61. 'default' => '1',
  62. 'desc' => '支付环境',
  63. 'match' => 'is_numeric',
  64. 'update' => 'radio',
  65. 'option' => $box,
  66. 'show' => 'alipay',
  67. ),
  68. 'system_source' => array
  69. (
  70. 'type' => 'tinyint-1',
  71. 'name' => '支付平台',
  72. 'default' => '1',
  73. 'desc' => '支付平台',
  74. 'match' => 'is_numeric',
  75. 'update' => 'radio',
  76. 'option' => $system_source,
  77. 'search' => 'select',
  78. 'list' => true,
  79. ),
  80. 'channel_id' => array
  81. (
  82. 'type' => 'int-11',
  83. 'name' => '所属渠道',
  84. 'default' => '1',
  85. 'desc' => '所属渠道',
  86. 'match' => 'is_numeric',
  87. 'update' => 'radio',
  88. 'option' => $channel,
  89. 'search' => 'select',
  90. 'list' => true,
  91. ),
  92. 'mchid' => array
  93. (
  94. 'type' => 'varchar-150',
  95. 'name' => '商户号',
  96. 'default' => '',
  97. 'desc' => '商户号',
  98. 'match' => 'is_string',
  99. 'update' => 'text',
  100. ),
  101. 'key' => array
  102. (
  103. 'type' => 'varchar-150',
  104. 'name' => '密匙key',
  105. 'default' => '',
  106. 'desc' => '密匙key',
  107. 'match' => 'is_string',
  108. 'update' => 'text',
  109. ),
  110. 'appid' => array
  111. (
  112. 'type' => 'varchar-150',
  113. 'name' => 'appid',
  114. 'default' => '',
  115. 'desc' => 'appid',
  116. 'match' => 'is_string',
  117. 'update' => 'text',
  118. 'show' => 'type=wechat,cmbc,alipay',
  119. ),
  120. 'appsecret' => array
  121. (
  122. 'type' => 'varchar-300',
  123. 'name' => 'appsecret',
  124. 'default' => '',
  125. 'desc' => 'appsecret',
  126. 'match' => 'is_string',
  127. 'update' => 'text',
  128. 'show' => 'type=wechat,cmbc',
  129. ),
  130. 'account' => array
  131. (
  132. 'type' => 'varchar-150',
  133. 'name' => '支付账号',
  134. 'default' => '',
  135. 'desc' => '支付账号',
  136. 'match' => 'is_string',
  137. 'update' => 'text',
  138. 'show' => 'type=alipay',
  139. ),
  140. 'private_key' => array
  141. (
  142. 'type' => 'text-255',
  143. 'name' => '商户私钥-https://doc.open.alipay.com/doc2/detail.htm?spm=a219a.7629140.0.0.nBDxfy&treeId=58&articleId=103242&docType=1',
  144. 'default' => '',
  145. 'desc' => '商户私钥',
  146. 'match' => 'is_string',
  147. 'update' => 'textarea',
  148. 'show' => 'type=alipay',
  149. ),
  150. 'm_public_key' => array
  151. (
  152. 'type' => 'varchar-1000',
  153. 'name' => '商户公钥-https://b.alipay.com/order/pidAndKey.htm',
  154. 'default' => '',
  155. 'desc' => '商户公钥',
  156. 'match' => 'is_string',
  157. 'update' => 'textarea',
  158. 'show' => 'type=alipay',
  159. ),
  160. 'public_key' => array
  161. (
  162. 'type' => 'varchar-1000',
  163. 'name' => '支付宝公钥-https://b.alipay.com/order/pidAndKey.htm',
  164. 'default' => '',
  165. 'desc' => '支付宝公钥',
  166. 'match' => 'is_string',
  167. 'update' => 'textarea',
  168. 'show' => 'type=alipay',
  169. ),
  170. 'appCertPath' => array
  171. (
  172. 'type' => 'varchar-150',
  173. 'name' => '支付宝appCertPath',
  174. 'default' => '',
  175. 'desc' => '证书cert文件',
  176. 'match' => 'option',
  177. 'update' => 'upload',
  178. 'key' => '4',
  179. 'show' => 'type=alipay',
  180. ),
  181. 'alipayCertPath' => array
  182. (
  183. 'type' => 'varchar-150',
  184. 'name' => '支付宝alipayCertPath',
  185. 'default' => '',
  186. 'desc' => '证书key文件',
  187. 'match' => 'option',
  188. 'update' => 'upload',
  189. 'key' => '4',
  190. 'show' => 'type=alipay',
  191. ),
  192. 'rootCertPath' => array
  193. (
  194. 'type' => 'varchar-150',
  195. 'name' => '支付宝rootCertPath',
  196. 'default' => '',
  197. 'desc' => '证书key文件',
  198. 'match' => 'option',
  199. 'update' => 'upload',
  200. 'key' => '4',
  201. 'show' => 'type=alipay',
  202. ),
  203. 'file_cert' => array
  204. (
  205. 'type' => 'varchar-150',
  206. 'name' => '证书cert文件-微信支付需要退款时使用',
  207. 'default' => '',
  208. 'desc' => '证书cert文件',
  209. 'match' => 'option',
  210. 'update' => 'upload',
  211. 'key' => '4',
  212. 'show' => 'type=wechat',
  213. ),
  214. 'file_key' => array
  215. (
  216. 'type' => 'varchar-150',
  217. 'name' => '证书key文件-微信支付需要退款时使用',
  218. 'default' => '',
  219. 'desc' => '证书key文件',
  220. 'match' => 'option',
  221. 'update' => 'upload',
  222. 'key' => '4',
  223. 'show' => 'type=wechat',
  224. ),
  225. 'timeout' => array
  226. (
  227. 'type' => 'int-11',
  228. 'name' => '支付有效期-秒',
  229. 'default' => '600',
  230. 'desc' => '支付有效期',
  231. 'match' => 'is_numeric',
  232. 'update' => 'text',
  233. ),
  234. 'state' => array
  235. (
  236. 'type' => 'tinyint-1',
  237. 'name' => '状态',
  238. 'default' => '1',
  239. 'desc' => '请选择状态',
  240. 'match' => 'is_numeric',
  241. ),
  242. 'cdate' => array
  243. (
  244. 'type' => 'int-11',
  245. 'name' => '申请时间',
  246. 'match' => array('is_numeric', time()),
  247. 'desc' => '',
  248. # 只有insert时才生效
  249. 'insert' => true,
  250. 'search' => 'date',
  251. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  252. ),
  253. ),
  254. 'manage' => array
  255. (
  256. # 自定义快捷新增和编辑
  257. 'button' => array
  258. (
  259. '渠道管理' => array('list', 'channel&project=pay&oper_parent=account&oper_project=pay'),
  260. ),
  261. ),
  262. # 默认值
  263. 'default' => array
  264. (
  265. 'col' => 'name,state,cdate',
  266. 'value' => array
  267. (
  268. '"公众号支付",1,' . time(),
  269. ),
  270. ),
  271. );