WithdrawEnum.php 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | LikeShop有特色的全开源社交分销电商系统
  4. // +----------------------------------------------------------------------
  5. // | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
  6. // | 商业用途务必购买系统授权,以免引起不必要的法律纠纷
  7. // | 禁止对系统程序代码以任何目的,任何形式的再发布
  8. // | 微信公众号:好象科技
  9. // | 访问官网:http://www.likemarket.net
  10. // | 访问社区:http://bbs.likemarket.net
  11. // | 访问手册:http://doc.likemarket.net
  12. // | 好象科技开发团队 版权所有 拥有最终解释权
  13. // +----------------------------------------------------------------------
  14. // | Author: LikeShopTeam
  15. // +----------------------------------------------------------------------
  16. namespace app\common\enum;
  17. /**
  18. * 提现枚举
  19. * Class WithdrawEnum
  20. * @package app\common\enum
  21. */
  22. class WithdrawEnum
  23. {
  24. /**
  25. * 默认值
  26. */
  27. const DEFAULT_MIN_MONEY = 0;
  28. const DEFAULT_MAX_MONEY = 100;
  29. const DEFAULT_PERCENTAGE = 10;
  30. const DEFAULT_TYPE = [self::TYPE_BALANCE];
  31. /**
  32. * 提现类型
  33. */
  34. const TYPE_BALANCE = 1; //余额
  35. const TYPE_WECHAT_CHANGE = 2; //微信零钱
  36. const TYPE_WECHAT_CODE = 4; //微信收款码
  37. const TYPE_ALI_CODE = 5; //阿里收款码
  38. const TYPE_BANK = 3; //银行卡
  39. /**
  40. * 提现状态
  41. */
  42. const STATUS_WAIT = 1;
  43. const STATUS_ING = 2;
  44. const STATUS_SUCCESS = 3;
  45. const STATUS_FAIL = 4;
  46. /**
  47. * 微信零钱提现方式
  48. */
  49. const ENTERPRISE = 1;//企业付款到零钱
  50. const MERCHANT = 2;//商家转账到零钱
  51. /**
  52. * @notes 获取提现类型描述
  53. * @param $type
  54. * @param false $flag
  55. * @return string|string[]
  56. * @author Tab
  57. * @date 2021/8/6 16:56
  58. */
  59. public static function getTypeDesc($type, $flag = false)
  60. {
  61. $desc = [
  62. self::TYPE_BALANCE => '钱包余额',
  63. self::TYPE_WECHAT_CHANGE => '微信零钱',
  64. self::TYPE_WECHAT_CODE => '微信收款码',
  65. self::TYPE_ALI_CODE => '支付宝收款码',
  66. self::TYPE_BANK => '银行卡',
  67. ];
  68. if($flag) {
  69. return $desc;
  70. }
  71. return $desc[$type] ?? '';
  72. }
  73. /**
  74. * @notes 获取状态描述
  75. * @param $status
  76. * @param false $flag
  77. * @return string|string[]
  78. * @author Tab
  79. * @date 2021/8/6 18:50
  80. */
  81. public static function getStatusDesc($status, $flag = false)
  82. {
  83. $desc = [
  84. self::STATUS_WAIT => '待提现',
  85. self::STATUS_ING => '提现中',
  86. self::STATUS_SUCCESS => '提现成功',
  87. self::STATUS_FAIL => '提现失败',
  88. ];
  89. if($flag) {
  90. return $desc;
  91. }
  92. return $desc[$status] ?? '';
  93. }
  94. }