截流自动化的商城平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ClientEnum.php 2.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | likeshop开源商城系统
  4. // +----------------------------------------------------------------------
  5. // | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
  6. // | gitee下载:https://gitee.com/likeshop_gitee
  7. // | github下载:https://github.com/likeshop-github
  8. // | 访问官网:https://www.likeshop.cn
  9. // | 访问社区:https://home.likeshop.cn
  10. // | 访问手册:http://doc.likeshop.cn
  11. // | 微信公众号:likeshop技术社区
  12. // | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
  13. // | likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
  14. // | 禁止对系统程序代码以任何目的,任何形式的再发布
  15. // | likeshop团队版权所有并拥有最终解释权
  16. // +----------------------------------------------------------------------
  17. // | author: likeshop.cn.team
  18. // +----------------------------------------------------------------------
  19. namespace app\common\enum;
  20. class ClientEnum
  21. {
  22. const unknown = 0;// 未知来源
  23. const mnp = 1;//小程序
  24. const oa = 2;//公众号
  25. const ios = 3;
  26. const android = 4;
  27. const pc = 5;
  28. const h5 = 6;//h5(非微信环境h5)
  29. function getName($value)
  30. {
  31. switch ($value) {
  32. case self::unknown:
  33. $name = '未知来源';
  34. break;
  35. case self::mnp:
  36. $name = '小程序';
  37. break;
  38. case self::h5:
  39. $name = 'h5';
  40. break;
  41. case self::ios:
  42. $name = '苹果';
  43. break;
  44. case self::android:
  45. $name = '安卓';
  46. break;
  47. case self::oa:
  48. $name = '公众号';
  49. break;
  50. }
  51. return $name;
  52. }
  53. public static function getClient($type = true)
  54. {
  55. $desc = [
  56. self::unknown => '未知来源',
  57. self::pc => 'pc商城',
  58. self::h5 => 'h5商城',
  59. self::oa => '公众号商城',
  60. self::mnp => '小程序商城',
  61. self::ios => '苹果APP商城',
  62. self::android => '安卓APP商城',
  63. ];
  64. if ($type === true) {
  65. return $desc;
  66. }
  67. return $desc[$type] ?? '未知来源';
  68. }
  69. }