优惠券小程序

GoodsCommonService.php 784B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: shensong
  5. * Date: 2022/10/19
  6. * Time: 17:27
  7. */
  8. namespace App\Service;
  9. class GoodsCommonService
  10. {
  11. public static function getPromotionId()
  12. {
  13. return config('haodanku.default_pid');
  14. }
  15. public static function getTaobaoUrl($itemId) {
  16. return 'https://item.taobao.com/item.htm?id='.$itemId;
  17. }
  18. /**
  19. * @param $shopType
  20. * @param $type 1 好单库 2淘宝客
  21. * @return mixed
  22. */
  23. public static function getShopType($shopType, $type)
  24. {
  25. if(1 == $type) {
  26. $arr = [
  27. 'B' => 1,
  28. 'C' => 2,
  29. ];
  30. return $arr[$shopType] ?? 2;
  31. } else if (2 == $type) {
  32. return $shopType == 1 ? 1 : 2;
  33. }
  34. }
  35. }