LiveEnum.php 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | likeshop100%开源免费商用商城系统
  4. // +----------------------------------------------------------------------
  5. // | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
  6. // | 开源版本可自由商用,可去除界面版权logo
  7. // | 商业版本务必购买商业授权,以免引起法律纠纷
  8. // | 禁止对系统程序代码以任何目的,任何形式的再发布
  9. // | gitee下载:https://gitee.com/likeshop_gitee
  10. // | github下载:https://github.com/likeshop-github
  11. // | 访问官网:https://www.likeshop.cn
  12. // | 访问社区:https://home.likeshop.cn
  13. // | 访问手册:http://doc.likeshop.cn
  14. // | 微信公众号:likeshop技术社区
  15. // | likeshop团队 版权所有 拥有最终解释权
  16. // +----------------------------------------------------------------------
  17. // | author: likeshopTeam
  18. // +----------------------------------------------------------------------
  19. namespace app\common\enum;
  20. class LiveEnum
  21. {
  22. const LIVE_ING = 101;
  23. const LIVE_NOT_START = 102;
  24. const LIVE_OVER = 103;
  25. const LIVE_FORBID = 104;
  26. const LIVE_STOP = 105;
  27. const LIVE_EXCEPTION = 106;
  28. const LIVE_OVERDUE = 107;
  29. const GOODS_UNREVIEWED = 0;
  30. const GOODS_AUDIT = 1;
  31. const GOODS_PASS = 2;
  32. const GOODS_PRJECT = 3;
  33. /**
  34. * @notes 获取直播间状态
  35. * @param bool $from
  36. * @return array|mixed|string
  37. * @author cjhao
  38. * @date 2021/11/22 15:25
  39. */
  40. public static function getLiveStatus($from = true){
  41. $desc = [
  42. self::LIVE_ING => '直播中',
  43. self::LIVE_NOT_START => '未开始',
  44. self::LIVE_OVER => '已结束',
  45. self::LIVE_FORBID => '禁播',
  46. self::LIVE_STOP => '暂停',
  47. self::LIVE_EXCEPTION => '异常',
  48. self::LIVE_OVERDUE => '已过期',
  49. ];
  50. if(true === $from){
  51. return $desc;
  52. }
  53. return $desc[$from] ?? '';
  54. }
  55. /**
  56. * @notes 商品状态
  57. * @param bool $from
  58. * @return array|mixed|string
  59. * @author cjhao
  60. * @date 2021/11/23 15:15
  61. */
  62. public static function getGoodsStatus($from = true){
  63. $desc = [
  64. self::GOODS_UNREVIEWED => '未审核',
  65. self::GOODS_AUDIT => '审核中',
  66. self::GOODS_PASS => '审核通过',
  67. self::GOODS_PRJECT => '审核驳回',
  68. ];
  69. if(true === $from){
  70. return $desc;
  71. }
  72. return $desc[$from] ?? '';
  73. }
  74. }