IntegralGoodsEnum.php 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | likeshop100%开源免费商用商城系统
  4. // +----------------------------------------------------------------------
  5. // | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
  6. // | 开源版本可自由商用,可去除界面版权logo
  7. // | 商业版本务必购买商业授权,以免引起法律纠纷
  8. // | 禁止对系统程序代码以任何目的,任何形式的再发布
  9. // | gitee下载:https://gitee.com/likeshop_gitee
  10. // | github下载:https://github.com/likeshop-github
  11. // | 访问官网:https://www.likeshop.cn
  12. // | 访问社区:https://home.likeshop.cn
  13. // | 访问手册:http://doc.likeshop.cn
  14. // | 微信公众号:likeshop技术社区
  15. // | likeshop团队 版权所有 拥有最终解释权
  16. // +----------------------------------------------------------------------
  17. // | author: likeshopTeam
  18. // +----------------------------------------------------------------------
  19. namespace app\common\enum;
  20. /**
  21. * 积分商品
  22. * Class IntegralGoodsEnum
  23. * @package app\common\enum
  24. */
  25. class IntegralGoodsEnum
  26. {
  27. // 兑换类型
  28. const TYPE_GOODS = 1; //商品
  29. const TYPE_BALANCE = 2; //红包(余额)
  30. // 商品状态
  31. const STATUS_SOLD_OUT = 0; //下架
  32. const STATUS_SHELVES = 1; //上架中
  33. // 兑换方式
  34. const EXCHANGE_WAY_INTEGRAL = 1; // 积分
  35. const EXCHANGE_WAY_HYBRID = 2; // 积分 + 金额
  36. // 物流类型
  37. const DELIVERY_NO_EXPRESS = 0; // 无需物流
  38. const DELIVERY_EXPRESS = 1; // 快递配送
  39. // 运费
  40. const EXPRESS_TYPE_FREE = 1; // 包邮
  41. const EXPRESS_TYPE_UNIFIED = 2; // 统一运费
  42. /**
  43. * @notes 兑换类型
  44. * @param bool $type
  45. * @return string|string[]
  46. * @author 段誉
  47. * @date 2022/2/25 17:48
  48. */
  49. public static function getTypeDesc($type = true)
  50. {
  51. $desc = [
  52. self::TYPE_GOODS => '商品',
  53. self::TYPE_BALANCE => '红包',
  54. ];
  55. if ($type === true) {
  56. return $desc;
  57. }
  58. return $desc[$type] ?? '';
  59. }
  60. }