ThirdPartyGoodCacheEnum.php 970 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. namespace app\common\enum\third;
  3. use app\common\enum\CommonEnum;
  4. class ThirdPartyGoodCacheEnum extends CommonEnum
  5. {
  6. const PLATFORM = [
  7. 'Taobao' => ['code' => 'TB', 'name' => '淘宝'],
  8. 'Jingdong' => ['code' => 'JD', 'name' => '京东'],
  9. 'Pdd' => ['code' => 'PDD', 'name' => '拼多多'],
  10. 'Suning' => ['code' => 'SN', 'name' => '苏宁'],
  11. 'Vipshop' => ['code' => 'VPH', 'name' => '唯品会'],
  12. 'Douyin' => ['code' => 'DY', 'name' => '抖音']
  13. ];
  14. /**
  15. * @param $type
  16. * @return mixed
  17. */
  18. public static function platformCodeMapByThirdPartyGoodEnumTypeCode($type)
  19. {
  20. $map = [
  21. 5 => self::PLATFORM['Taobao']['code'],
  22. 6 => self::PLATFORM['Jingdong']['code'],
  23. 1 => self::PLATFORM['Pdd']['code'],
  24. 3 => self::PLATFORM['Suning']['code'],
  25. 2 => self::PLATFORM['Vipshop']['code'],
  26. ];
  27. return $map[$type];
  28. }
  29. }