1234567891011121314151617181920212223242526272829303132333435363738394041 |
- <?php
- /**
- * Created by PhpStorm.
- * User: shensong
- * Date: 2022/10/19
- * Time: 17:27
- */
- namespace App\Service;
- class GoodsCommonService
- {
- public static function getPromotionId()
- {
- return config('haodanku.default_pid');
- }
- public static function getTaobaoUrl($itemId) {
- return 'https://item.taobao.com/item.htm?id='.$itemId;
- }
- /**
- * @param $shopType
- * @param $type 1 好单库 2淘宝客
- * @return mixed
- */
- public static function getShopType($shopType, $type)
- {
- if(1 == $type) {
- $arr = [
- 'B' => 1,
- 'C' => 2,
- ];
- return $arr[$shopType] ?? 2;
- } else if (2 == $type) {
- return $shopType == 1 ? 1 : 2;
- }
- }
- }
|