AddonsJoinPayEnum.php 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <?php
  2. namespace addons\JoinPay\common\enums;
  3. use common\enums\BaseEnum;
  4. /**
  5. * Class AddonsCouponEnum
  6. * @package addons\Coupon\common\enums
  7. */
  8. class AddonsJoinPayEnum extends BaseEnum
  9. {
  10. // 账号类型
  11. const ACCOUNT_FOR_PUBLIC = 202;
  12. const ACCOUNT_FOR_PRIVATE = 201;
  13. // 货币类型
  14. const CURRENCY_RMB = 201;
  15. const CURRENCY_DOLLAR = 202;
  16. // 是否复核
  17. const REVIEW_NEED = 201;
  18. const REVIEW_NO = 202;
  19. // 代付用途
  20. const PAID_PURPOSE1 = 201;
  21. const PAID_PURPOSE2 = 202;
  22. const PAID_PURPOSE3 = 203;
  23. const PAID_PURPOSE4 = 204;
  24. const PAID_PURPOSE5 = 205;
  25. const PAID_PURPOSE6 = 206;
  26. // 处理状态
  27. const HANDLE_STATUS0 = 0;
  28. const HANDLE_STATUS1 = 1;
  29. const HANDLE_STATUS2 = 2;
  30. public static function getAccountTypeMap(int $account_type = null)
  31. {
  32. $map = [
  33. self::ACCOUNT_FOR_PUBLIC => '对公',
  34. self::ACCOUNT_FOR_PRIVATE => '对私',
  35. ];
  36. if ($account_type !== null) return $map[$account_type];
  37. return $map;
  38. }
  39. public static function getCurrencyTypeMap(int $currency_type = null)
  40. {
  41. $map = [
  42. self::CURRENCY_RMB => '人民币',
  43. self::CURRENCY_DOLLAR => '美元',
  44. ];
  45. if ($currency_type !== null) return $map[$currency_type];
  46. return $map;
  47. }
  48. public static function getReviewMap(int $is_review = null)
  49. {
  50. $map = [
  51. self::REVIEW_NEED => '需要复核',
  52. self::REVIEW_NO => '不需要复核',
  53. ];
  54. if ($is_review !== null) return $map[$is_review];
  55. return $map;
  56. }
  57. // public static function getPaidPurposeMap(int $paid_purpose = null)
  58. // {
  59. // $map = [
  60. // self::PAID_PURPOSE1 => '对公',
  61. // self::PAID_PURPOSE2 => '对私',
  62. // self::PAID_PURPOSE3 => '对私',
  63. // self::PAID_PURPOSE4 => '对私',
  64. // self::PAID_PURPOSE5 => '对私',
  65. // self::PAID_PURPOSE6 => '对私',
  66. // ];
  67. // if ($paid_purpose !== null) return $map[$paid_purpose];
  68. // return $map;
  69. // }
  70. public static function getHandleStatusMap(int $status = null)
  71. {
  72. $map = [
  73. self::HANDLE_STATUS0 => '等待处理',
  74. self::HANDLE_STATUS1 => '成功',
  75. self::HANDLE_STATUS2 => '失败',
  76. ];
  77. if ($status !== null) return $map[$status];
  78. return $map;
  79. }
  80. public static function getMap(): array
  81. {
  82. return [];
  83. }
  84. }