| 123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- <?php
- namespace App\Module\Ulogic\logic;
- use App\Module\Ulogic\Enum\PUNISH_TYPE;
- /**
- * 违规等级
- *
- */
- class PunishLevel
- {
- static protected $level = [];
- /**
- * 获取登记
- * @return array-key
- */
- static public function getLevel():array
- {
- if (!self::$level) {
- self::$level[PUNISH_TYPE::OrderNoPay->value()] = 1;
- self::$level[PUNISH_TYPE::OrderComplaint->value()] = 1;
- self::$level[PUNISH_TYPE::OrderRealInconsistent->value()] = 10;
- self::$level[PUNISH_TYPE::OrderPayCheat->value()] = 10;
- }
- return self::$level;
- }
- /**
- * 等级 匹配
- * @param PUNISH_TYPE $punishType
- * @return int|mixed
- */
- static public function levelMatch(PUNISH_TYPE $punishType)
- {
- $list = self::getLevel();
- return $list[$punishType->value()] ?? 99;
- }
- }
|