FreeShippingEnum.php 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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. */
  23. class FreeShippingEnum
  24. {
  25. const WAIT = 0;
  26. const ING = 1;
  27. const END = 2;
  28. const ALL_USER = 1;
  29. const ALL_GOODS = 1;
  30. const BY_AMOUNT = 1;
  31. const BY_QUANTITY = 2;
  32. /**
  33. * @notes 获取状态描述
  34. */
  35. public static function getStatusDesc($value = null)
  36. {
  37. $desc = [
  38. self::WAIT => '未开始',
  39. self::ING => '进行中',
  40. self::END => '已结束',
  41. ];
  42. if (is_null($value)) {
  43. return $desc;
  44. }
  45. return $desc[$value] ?? '';
  46. }
  47. /**
  48. * @notes 获取目标用户类型描述
  49. */
  50. public static function getTargetUserTypeDesc($value = null)
  51. {
  52. $desc = [
  53. self::ALL_USER => '全部用户',
  54. ];
  55. if (is_null($value)) {
  56. return $desc;
  57. }
  58. return $desc[$value] ?? '';
  59. }
  60. /**
  61. * @notes 获取目标用户类型描述
  62. */
  63. public static function getTargetGoodsTypeDesc($value = null)
  64. {
  65. $desc = [
  66. self::ALL_GOODS => '全部商品',
  67. ];
  68. if (is_null($value)) {
  69. return $desc;
  70. }
  71. return $desc[$value] ?? '';
  72. }
  73. /**
  74. * @notes 获取条件类型
  75. */
  76. public static function getConditionTypeDesc($value = null)
  77. {
  78. $desc = [
  79. self::BY_AMOUNT => '按订单实付金额',
  80. self::BY_QUANTITY => '按购买件数',
  81. ];
  82. if (is_null($value)) {
  83. return $desc;
  84. }
  85. return $desc[$value] ?? '';
  86. }
  87. }