'可用积分', self::FROZEN => '冻结积分', }; } /** * 获取分类描述 * * @return string 分类描述 */ public function getDescription(): string { return match($this) { self::AVAILABLE => '用户可以正常使用的积分', self::FROZEN => '被系统冻结暂时无法使用的积分', }; } /** * 获取所有分类 * * @return array 所有分类数组 */ public static function getAllCategories(): array { return [ self::AVAILABLE->value => self::AVAILABLE->getCategoryName(), self::FROZEN->value => self::FROZEN->getCategoryName(), ]; } }