diff --git a/app/admin/controller/Goods.php b/app/admin/controller/Goods.php index d3b14de0..57c2b046 100644 --- a/app/admin/controller/Goods.php +++ b/app/admin/controller/Goods.php @@ -498,7 +498,19 @@ class Goods extends Controller } - + /** + * 商品抓取 + * [collector description] + * @return [type] [description] + */ + public function collector(string $sku): Json{ + $res = getJdGoodsBySku([$sku]); + // $collector = new \app\job\service\goods\Collector; + // $url = "https://item.jd.com/{$sku}.html"; + // $res1 = $collector->collector($url, 10048); + + return $this->renderSuccess($res[$sku] ?? []); + } diff --git a/app/store/controller/Goods.php b/app/store/controller/Goods.php index 1ffe132f..4961e2f3 100644 --- a/app/store/controller/Goods.php +++ b/app/store/controller/Goods.php @@ -369,7 +369,7 @@ class Goods extends Controller * @return [type] [description] */ public function collector(string $sku): Json{ - $res = getJdGoodsBySku([$sku], 10048, 0, true); + $res = getJdGoodsBySku([$sku]); // $collector = new \app\job\service\goods\Collector; // $url = "https://item.jd.com/{$sku}.html"; // $res1 = $collector->collector($url, 10048); diff --git a/app/store/model/Goods.php b/app/store/model/Goods.php index 40d2f971..1f274f46 100644 --- a/app/store/model/Goods.php +++ b/app/store/model/Goods.php @@ -383,7 +383,7 @@ class Goods extends GoodsModel continue; } $inImage = [ - 'file_path' => $value['image'], + 'file_path' => $value['preview_url'], 'store_id' => self::$storeId, 'merchant_id' => $data['merchant_id'] ?? 0, 'storage' => "external",