FeedbackEnum.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <?php
  2. namespace app\common\Enum;
  3. /**
  4. * 全局状态枚举
  5. */
  6. class FeedbackEnum
  7. {
  8. const PRODUCT_FUNCTION_FEEDBACK = 'PRODUCT_FUNCTION_FEEDBACK'; // 产品功能反馈
  9. const PRODUCT_BUG_FEEDBACK = 'PRODUCT_BUG_FEEDBACK'; // 产品bug反馈
  10. const OTHER_FEEDBACK = 'OTHER_FEEDBACK'; // 其他反馈
  11. // 反馈类型列表
  12. const FEEDBACK_TYPE_LIST = [
  13. self::PRODUCT_FUNCTION_FEEDBACK,
  14. self::PRODUCT_BUG_FEEDBACK,
  15. self::OTHER_FEEDBACK,
  16. ];
  17. const PROCESS_STATUS_UNPROCESSED = 1; // 未处理
  18. const PROCESS_STATUS_PROCESSED = 2; // 已处理
  19. const PROCESS_STATUS_LIST = [
  20. self::PROCESS_STATUS_UNPROCESSED,
  21. self::PROCESS_STATUS_PROCESSED,
  22. ];
  23. /**
  24. * 获取状态描述
  25. * @param int $status
  26. * @return string
  27. */
  28. public static function getFeedbackTypeText($status)
  29. {
  30. $map = self::getFeedbackTypeMap();
  31. return $map[$status] ?? '未知';
  32. }
  33. /**
  34. * 获取状态映射
  35. * @return array
  36. */
  37. public static function getFeedbackTypeMap()
  38. {
  39. return [
  40. self::PRODUCT_FUNCTION_FEEDBACK => '产品功能反馈',
  41. self::PRODUCT_BUG_FEEDBACK => '产品bug反馈',
  42. self::OTHER_FEEDBACK => '其他反馈',
  43. ];
  44. }
  45. /**
  46. * 获取处理状态映射
  47. * @return array
  48. */
  49. public static function getProcessStatusMap()
  50. {
  51. return [
  52. self::PROCESS_STATUS_UNPROCESSED => '未处理',
  53. self::PROCESS_STATUS_PROCESSED => '已处理',
  54. ];
  55. }
  56. public static function getProcessStatusText($status)
  57. {
  58. $map = self::getProcessStatusMap();
  59. return $map[$status] ?? '未知';
  60. }
  61. }