TransferDict.php 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | Niucloud-admin 企业快速开发的saas管理平台
  4. // +----------------------------------------------------------------------
  5. // | 官方网址:https://www.niucloud.com
  6. // +----------------------------------------------------------------------
  7. // | niucloud团队 版权所有 开源版本可自由商用
  8. // +----------------------------------------------------------------------
  9. // | Author: Niucloud Team
  10. // +----------------------------------------------------------------------
  11. namespace app\dict\pay;
  12. class TransferDict
  13. {
  14. public const WECHAT = 'wechatpay';//微信零钱
  15. public const ALIPAY = 'alipay';//支付宝支付 (默认收款码)
  16. public const OFFLINE = 'offline';//线下转账
  17. public const BANK = 'bank';//银行卡转账
  18. public const WECHAT_CODE = 'wechat_code';//微信收款码(线下转账)
  19. //转账状态
  20. public const SUCCESS = 'success';//转账成功
  21. public const DEALING = 'dealing';//处理中
  22. public const WAIT = 'wait';//待转账
  23. public const WAIT_USER = 'wait_user';//等待用户确认
  24. public const WAIT_USER_ING = 'wait_user_ing';//用户确认.转账中
  25. public const FAIL_ING = 'fail_ing';//转账撤销中
  26. public const FAIL = 'fail';//失败
  27. public static function getPayTypeByTransfer(string $type = '')
  28. {
  29. $list = array(
  30. self::WECHAT => PayDict::WECHATPAY,
  31. self::ALIPAY => PayDict::ALIPAY,
  32. );
  33. if (empty($type))
  34. return $list;
  35. return $list[$type];
  36. }
  37. /**
  38. * 转账类型
  39. * @return array
  40. */
  41. public static function getTransferType(array $types = [], $is_all = true)
  42. {
  43. $list = [
  44. self::WECHAT => [
  45. 'name' => get_lang('dict_transfer.type_wechat'),
  46. 'key' => self::WECHAT,
  47. 'is_online' => true
  48. ],//微信
  49. self::WECHAT_CODE => [
  50. 'name' => get_lang('dict_transfer.type_wechat_code'),
  51. 'key' => self::WECHAT_CODE,
  52. 'is_online' => false
  53. ],//微信收款码(线下转账)
  54. self::ALIPAY => [
  55. 'name' => get_lang('dict_transfer.type_ali'),
  56. 'key' => self::ALIPAY,
  57. 'is_online' => false
  58. ],//支付宝
  59. self::BANK => [
  60. 'name' => get_lang('dict_transfer.type_bank'),
  61. 'key' => self::BANK,
  62. 'is_online' => false
  63. ],//银行卡
  64. ];
  65. if ($is_all) {
  66. $list[self::OFFLINE] = [
  67. 'name' => get_lang('dict_transfer.type_offline'),
  68. 'key' => self::OFFLINE,
  69. 'is_online' => false
  70. ];
  71. }
  72. if (!empty($types)) {
  73. foreach ($list as $k => $v) {
  74. if (!in_array($k, $types)) {
  75. unset($list[$k]);
  76. }
  77. }
  78. }
  79. return $list;
  80. }
  81. /**
  82. * 获取状态
  83. * @return array
  84. */
  85. public static function getStatus()
  86. {
  87. return [
  88. self::WAIT => get_lang('dict_transfer.status_wait'),
  89. self::DEALING => get_lang('dict_transfer.status_dealing'),
  90. self::WAIT_USER => get_lang('dict_transfer.status_wait_user'),
  91. self::WAIT_USER_ING => get_lang('dict_transfer.wait_user_ing'),
  92. self::SUCCESS => get_lang('dict_transfer.status_success'),
  93. self::FAIL => get_lang('dict_transfer.status_fail'),
  94. self::FAIL_ING => get_lang('dict_transfer.status_fail_ing'),
  95. ];
  96. }
  97. public const XJYX = 'xjyx';
  98. public const QYPF = 'qypf';
  99. public const YJBC = 'yjbc';
  100. public const CGHK = 'cghk';
  101. public const ESHS = 'eshs';
  102. public const GYBZ = 'gybz';
  103. public const XZBT = 'xzbt';
  104. public const BXLP = 'bxlp';
  105. /**
  106. * 获取微信转账场景
  107. * @return array
  108. */
  109. public static function getWechatTransferScene(){
  110. return [
  111. self::YJBC => [
  112. 'name' => '佣金报酬',
  113. 'user_recv_perception' => [
  114. '劳务报酬',
  115. '报销款',
  116. '企业补贴',
  117. '开工利是'
  118. ],
  119. 'transfer_scene_report_infos' => [
  120. '岗位类型',
  121. '报酬说明'
  122. ]
  123. ],
  124. self::XJYX => [
  125. 'name' => '现金营销',
  126. 'user_recv_perception' => [
  127. '活动奖励',
  128. '现金奖励',
  129. ],
  130. 'transfer_scene_report_infos' => [
  131. '活动名称',
  132. '奖励说明'
  133. ]
  134. ],
  135. self::QYPF => [
  136. 'name' => '企业赔付',
  137. 'user_recv_perception' => [
  138. '退款',
  139. '商家赔付',
  140. ],
  141. 'transfer_scene_report_infos' => [
  142. '赔付原因',
  143. ]
  144. ],
  145. self::CGHK => [
  146. 'name' => '采购货款',
  147. 'user_recv_perception' => [
  148. '货款',
  149. ],
  150. 'transfer_scene_report_infos' => [
  151. '采购商品名称',
  152. ]
  153. ],
  154. self::ESHS => [
  155. 'name' => '二手回收',
  156. 'user_recv_perception' => [
  157. '二手回收货款',
  158. ],
  159. 'transfer_scene_report_infos' => [
  160. '回收商品名称',
  161. ]
  162. ],
  163. self::GYBZ => [
  164. 'name' => '公益补助',
  165. 'user_recv_perception' => [
  166. '公益补助金',
  167. ],
  168. 'transfer_scene_report_infos' => [
  169. '公益活动名称',
  170. '公益活动备案编号'
  171. ]
  172. ],
  173. self::XZBT => [
  174. 'name' => '行政补贴',
  175. 'user_recv_perception' => [
  176. '行政补贴',
  177. '行政奖励'
  178. ],
  179. 'transfer_scene_report_infos' => [
  180. '补贴类型',
  181. ]
  182. ],
  183. self::BXLP => [
  184. 'name' => '保险理赔',
  185. 'user_recv_perception' => [
  186. '保险理赔款',
  187. ],
  188. 'transfer_scene_report_infos' => [
  189. '保险产品备案编号',
  190. '保险名称',
  191. '保险操作单号'
  192. ]
  193. ],
  194. ];
  195. }
  196. }