PosterDict.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | Niucloud-admin 企业快速开发的saas管理平台
  4. // +----------------------------------------------------------------------
  5. // | 官方网址:https://www.niucloud.com
  6. // +----------------------------------------------------------------------
  7. // | niucloud团队 版权所有 开源版本可自由商用
  8. // +----------------------------------------------------------------------
  9. // | Author: Niucloud Team
  10. // +----------------------------------------------------------------------
  11. namespace app\dict\sys;
  12. /**
  13. * 海报枚举类
  14. */
  15. class PosterDict
  16. {
  17. /**
  18. * 获取方式
  19. * @param string $type
  20. * @return array
  21. */
  22. public static function getType($type = '')
  23. {
  24. $list = [];
  25. $temp = array_filter(event('GetPosterType') ?? []);
  26. foreach ($temp as $v) {
  27. $list = array_merge($list, $v);
  28. }
  29. if (!empty($type)) {
  30. $item = [];
  31. foreach ($list as $v) {
  32. if ($v[ 'type' ] == $type) {
  33. $item = $v;
  34. break;
  35. }
  36. }
  37. return $item;
  38. } else {
  39. return $list;
  40. }
  41. }
  42. public const ON = '1';//开启
  43. public const OFF = '2';//关闭
  44. /**
  45. * 状态
  46. * @return array
  47. */
  48. public static function getStatus()
  49. {
  50. return [
  51. self::ON => '启用',
  52. self::OFF => '关闭',
  53. ];
  54. }
  55. }