MembershipLevel.php 815 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. namespace fast;
  3. /**
  4. * 会员等级
  5. */
  6. class MembershipLevel
  7. {
  8. /**
  9. * 无等级
  10. */
  11. const NOLevel = 0;
  12. /**
  13. * 市场会员
  14. */
  15. const MarketMembership = 1;
  16. /**
  17. * 社区长
  18. */
  19. const CommunityLeader = 2;
  20. /**
  21. * 系统领导人
  22. */
  23. const SystemLeader = 3;
  24. private static array $actions = [
  25. self::NOLevel => '无等级',
  26. self::MarketMembership => '市场会员',
  27. self::CommunityLeader => '公司俱乐部',
  28. self::SystemLeader => '分公司',
  29. ];
  30. public static function getText(int $value): string
  31. {
  32. if (array_key_exists($value, self::$actions)) {
  33. return self::$actions[$value];
  34. } else {
  35. return Common::getUnknownText();
  36. }
  37. }
  38. }