PunishLevel.php 894 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. namespace App\Module\Ulogic\logic;
  3. use App\Module\Ulogic\Enum\PUNISH_TYPE;
  4. /**
  5. * 违规等级
  6. *
  7. */
  8. class PunishLevel
  9. {
  10. static protected $level = [];
  11. /**
  12. * 获取登记
  13. * @return array-key
  14. */
  15. static public function getLevel():array
  16. {
  17. if (!self::$level) {
  18. self::$level[PUNISH_TYPE::OrderNoPay->value()] = 1;
  19. self::$level[PUNISH_TYPE::OrderComplaint->value()] = 1;
  20. self::$level[PUNISH_TYPE::OrderRealInconsistent->value()] = 10;
  21. self::$level[PUNISH_TYPE::OrderPayCheat->value()] = 10;
  22. }
  23. return self::$level;
  24. }
  25. /**
  26. * 等级 匹配
  27. * @param PUNISH_TYPE $punishType
  28. * @return int|mixed
  29. */
  30. static public function levelMatch(PUNISH_TYPE $punishType)
  31. {
  32. $list = self::getLevel();
  33. return $list[$punishType->value()] ?? 99;
  34. }
  35. }