ThirdPartyEnum.php 1000 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. namespace app\common\enum;
  3. /**
  4. * 第三方
  5. */
  6. class ThirdPartyEnum
  7. {
  8. const KUAIDI100 = 1;
  9. /**
  10. * 面单类型
  11. */
  12. const FACE_SHEET_TYPE = [
  13. self::KUAIDI100
  14. ];
  15. /**
  16. * @notes 获取第三方平台描述
  17. * @param null $thirdParty
  18. * @param string $lang
  19. * @return mixed|string|string[]
  20. * @author Tab
  21. * @date 2021/11/22 11:30
  22. */
  23. public static function getThirdPartyDesc($thirdParty = null, $lang = 'zh')
  24. {
  25. $zhDesc = [
  26. self::KUAIDI100 => '快递100'
  27. ];
  28. $enDesc = [
  29. self::KUAIDI100 => 'kuaidi100'
  30. ];
  31. if (is_null($thirdParty) && $lang == 'zh') {
  32. return $zhDesc;
  33. }
  34. if (is_null($thirdParty) && $lang == 'en') {
  35. return $enDesc;
  36. }
  37. if ($lang == 'zh') {
  38. return $zhDesc[$thirdParty] ?? '';
  39. }
  40. if ($lang == 'en') {
  41. return $enDesc[$thirdParty] ?? '';
  42. }
  43. }
  44. }