ChannelDict.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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\common;
  12. /**
  13. * 渠道枚举类
  14. * Class ChannelDict
  15. * @package app\dict\common
  16. */
  17. class ChannelDict
  18. {
  19. //微信小程序
  20. public const WEAPP = 'weapp';
  21. //微信公众号
  22. public const WECHAT = 'wechat';
  23. //手机端H5
  24. public const H5 = 'h5';
  25. //电脑端PC
  26. public const PC = 'pc';
  27. //app端
  28. public const APP = 'app';
  29. public static function getType($type = '')
  30. {
  31. $data = [
  32. self::WEAPP => get_lang('dict_channel.channel_weapp'),//微信小程序
  33. self::WECHAT => get_lang('dict_channel.channel_wechat'),//'微信公众号',
  34. self::H5 => get_lang('dict_channel.channel_h5'),//'手机H5',
  35. self::PC => get_lang('dict_channel.channel_pc'),//'电脑PC',
  36. self::APP => get_lang('dict_channel.channel_app'),//'手机app',
  37. ];
  38. if (empty($type)) {
  39. return $data;
  40. }
  41. return $data[$type] ?? '';
  42. }
  43. }