123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- <?php
- namespace app\common\Enum;
- /**
- * 全局状态枚举
- */
- class FeedbackEnum
- {
- const PRODUCT_FUNCTION_FEEDBACK = 'PRODUCT_FUNCTION_FEEDBACK'; // 产品功能反馈
- const PRODUCT_BUG_FEEDBACK = 'PRODUCT_BUG_FEEDBACK'; // 产品bug反馈
- const OTHER_FEEDBACK = 'OTHER_FEEDBACK'; // 其他反馈
- // 反馈类型列表
- const FEEDBACK_TYPE_LIST = [
- self::PRODUCT_FUNCTION_FEEDBACK,
- self::PRODUCT_BUG_FEEDBACK,
- self::OTHER_FEEDBACK,
- ];
- const PROCESS_STATUS_UNPROCESSED = 1; // 未处理
- const PROCESS_STATUS_PROCESSED = 2; // 已处理
- const PROCESS_STATUS_LIST = [
- self::PROCESS_STATUS_UNPROCESSED,
- self::PROCESS_STATUS_PROCESSED,
- ];
- /**
- * 获取状态描述
- * @param int $status
- * @return string
- */
- public static function getFeedbackTypeText($status)
- {
- $map = self::getFeedbackTypeMap();
- return $map[$status] ?? '未知';
- }
- /**
- * 获取状态映射
- * @return array
- */
- public static function getFeedbackTypeMap()
- {
- return [
- self::PRODUCT_FUNCTION_FEEDBACK => '产品功能反馈',
- self::PRODUCT_BUG_FEEDBACK => '产品bug反馈',
- self::OTHER_FEEDBACK => '其他反馈',
- ];
- }
- /**
- * 获取处理状态映射
- * @return array
- */
- public static function getProcessStatusMap()
- {
- return [
- self::PROCESS_STATUS_UNPROCESSED => '未处理',
- self::PROCESS_STATUS_PROCESSED => '已处理',
- ];
- }
- public static function getProcessStatusText($status)
- {
- $map = self::getProcessStatusMap();
- return $map[$status] ?? '未知';
- }
- }
|