AddonsShortVideoEnum.php 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. <?php
  2. namespace addons\ShortVideo\common\enums;
  3. use common\enums\BaseEnum;
  4. /**
  5. * Class AddonsCouponEnum
  6. * @package addons\Coupon\common\enums
  7. */
  8. class AddonsShortVideoEnum extends BaseEnum
  9. {
  10. // 短视频应用开启状态
  11. const IS_ENABLE_YES = 1;
  12. const IS_ENABLE_NO = 0;
  13. // 发布的视频是否需要审核
  14. const IS_AUDIT_YES = 1;
  15. const IS_AUDIT_NO = 0;
  16. // 视频发布权限
  17. const RELEASE_RULE0 = 0; // 无条件
  18. const RELEASE_RULE1 = 1; // 有条件
  19. // 是否开启全局带货奖励
  20. const AWARD_STATUS0 = 0; // 不开启
  21. const AWARD_STATUS1 = 1; // 开启
  22. // 奖励计算方式
  23. const AWARD_TYPE0 = 0; // 按照设置的固定值计算
  24. const award_type1 = 1; // 按照百分比计算
  25. // 是否开启敏感词检测
  26. const CLIENT_STATUS0 = 0; // 不开启
  27. const CLIENT_STATUS1 = 1; // 开启
  28. // 视频关联类型
  29. const VIDEO_RELATE_TYPE1 = 1;
  30. const VIDEO_RELATE_TYPE2 = 2;
  31. const VIDEO_RELATE_TYPE3 = 3;
  32. // 视频审核状态
  33. const VIDEO_AUDIT_STATUS0 = 0;
  34. const VIDEO_AUDIT_STATUS1 = 1;
  35. const VIDEO_AUDIT_STATUS2 = 2;
  36. // 视频奖励会员类型
  37. const VIDEO_REWARD_USER_TYPE0 = 0;
  38. const VIDEO_REWARD_USER_TYPE1 = 1;
  39. const VIDEO_REWARD_USER_TYPE2 = 2;
  40. // 视频奖励类型
  41. const VIDEO_REWARD_TYPE0 = 0;
  42. const VIDEO_REWARD_TYPE1 = 1;
  43. const LOCK_SHORT_VIDEO_BROWSE_AWARD = 'lock_short_video_browse_award_';
  44. public static function getEnableMap($is_enable = null)
  45. {
  46. $map = [
  47. self::IS_ENABLE_NO => '未开启',
  48. self::IS_ENABLE_YES => '开启',
  49. ];
  50. if (!is_null($is_enable)) {
  51. return $map[$is_enable];
  52. }
  53. return $map;
  54. }
  55. public static function getAuditMap($is_audit = null)
  56. {
  57. $map = [
  58. self::IS_AUDIT_YES => '需要审核',
  59. self::IS_AUDIT_NO => '不审核',
  60. ];
  61. if (!is_null($is_audit)) {
  62. return $map[$is_audit];
  63. }
  64. return $map;
  65. }
  66. public static function getClientStatusMap($client_status = null)
  67. {
  68. $map = [
  69. self::CLIENT_STATUS0 => '不开启',
  70. self::CLIENT_STATUS1 => '开启',
  71. ];
  72. if (!is_null($client_status)) {
  73. return $map[$client_status];
  74. }
  75. return $map;
  76. }
  77. public static function getRelateTypeMap($relate_type = null)
  78. {
  79. $map = [
  80. self::VIDEO_RELATE_TYPE1 => '关联商品',
  81. self::VIDEO_RELATE_TYPE2 => '关联店铺',
  82. self::VIDEO_RELATE_TYPE3 => '关联地址',
  83. ];
  84. if (!is_null($relate_type)) {
  85. return $map[$relate_type];
  86. }
  87. return $map;
  88. }
  89. public static function getAuditStatusMap($audit_status = null)
  90. {
  91. $map = [
  92. self::VIDEO_AUDIT_STATUS0 => '未审核',
  93. self::VIDEO_AUDIT_STATUS1 => '审核通过',
  94. self::VIDEO_AUDIT_STATUS2 => '审核不通过',
  95. ];
  96. if (!is_null($audit_status)) {
  97. return $map[$audit_status];
  98. }
  99. return $map;
  100. }
  101. public static function getUserTypeMap($user_type = null)
  102. {
  103. $map = [
  104. self::VIDEO_REWARD_USER_TYPE0 => '本人',
  105. self::VIDEO_REWARD_USER_TYPE1 => '一级',
  106. self::VIDEO_REWARD_USER_TYPE2 => '二级',
  107. ];
  108. if (!is_null($user_type)) {
  109. return $map[$user_type];
  110. }
  111. return $map;
  112. }
  113. public static function getRewardTypeMap($reward_type = null)
  114. {
  115. $map = [
  116. self::VIDEO_REWARD_TYPE0 => '积分',
  117. self::VIDEO_REWARD_TYPE1 => '现金',
  118. ];
  119. if (!is_null($reward_type)) {
  120. return $map[$reward_type];
  121. }
  122. return $map;
  123. }
  124. public static function getMap(): array
  125. {
  126. return [];
  127. }
  128. }