WithdrawEnum.php 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. namespace app\common\enum;
  3. class WithdrawEnum
  4. {
  5. //提现类型
  6. const TYPE_BALANCE = 1; // 提现到钱包余额
  7. const TYPE_WECHAT_CHANGE = 2; // 提现到微信零钱
  8. const TYPE_WECHAT_CODE = 3; // 提现到微信收款码
  9. const TYPE_ALI_CODE = 4; // 提现到支付宝收款码
  10. const TYPE_BANK = 5; // 提现到银行卡
  11. //提现状态
  12. const STATUS_WAIT = 1; // 待提现
  13. const STATUS_ING = 2; // 提现中
  14. const STATUS_SUCCESS = 3; // 提现成功
  15. const STATUS_FAIL = 4; //提现失败
  16. //提现到微信零钱 是否待收款
  17. static function wechatChangeIsWaitReceive($data)
  18. {
  19. return intval($data['status'] == self::STATUS_ING && $data['type'] == self::TYPE_WECHAT_CHANGE);
  20. }
  21. //提现状态
  22. public static function getStatusDesc($status = true, $data = [])
  23. {
  24. $desc = [
  25. self::STATUS_WAIT => '待提现',
  26. self::STATUS_ING => '提现中',
  27. self::STATUS_SUCCESS => '提现成功',
  28. self::STATUS_FAIL => '提现失败'
  29. ];
  30. if (isset($data['type']) && $data['type'] == static::TYPE_WECHAT_CHANGE) {
  31. $desc[self::STATUS_ING] = '待收款';
  32. }
  33. if ($status === true) {
  34. return $desc;
  35. }
  36. return $desc[$status] ?? '';
  37. }
  38. //提现类型
  39. public static function getTypeDesc($status = true)
  40. {
  41. $desc = [
  42. self::TYPE_BALANCE => '钱包余额',
  43. self::TYPE_WECHAT_CHANGE => '微信零钱',
  44. self::TYPE_BANK => '银行卡',
  45. self::TYPE_WECHAT_CODE => '微信收款码',
  46. self::TYPE_ALI_CODE => '支付宝收款码',
  47. ];
  48. if ($status === true) {
  49. return $desc;
  50. }
  51. return $desc[$status] ?? '';
  52. }
  53. }