From 030c4153431bcbeed45a3d4b5edb1028e6e3874e Mon Sep 17 00:00:00 2001 From: lqmac Date: Sat, 20 Apr 2024 00:25:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/job/service/goods/AdminImport.php | 2 +- app/job/service/goods/Collector.php | 2 +- app/store/controller/Goods.php | 2 +- app/store/model/goods/Import.php | 11 ++++++++++- app/store/service/Upload.php | 12 +++++++----- 5 files changed, 20 insertions(+), 9 deletions(-) diff --git a/app/job/service/goods/AdminImport.php b/app/job/service/goods/AdminImport.php index 5808c89c..dbf48b39 100644 --- a/app/job/service/goods/AdminImport.php +++ b/app/job/service/goods/AdminImport.php @@ -245,7 +245,7 @@ class AdminImport extends BaseService 'delivery_id' => $original["K"], //'link' => $original["D"], 'categoryIds' => $this->ids2array($original["E"]), - 'imageStorage' => 10,//下载图片到本地 + 'imageStorage' => 20,//下载图片到本地 'goods_type' => 10,//实物 'goods_status' => 10,//上架 'store_id' => $storeId, diff --git a/app/job/service/goods/Collector.php b/app/job/service/goods/Collector.php index ed7a6fae..6ba418e5 100644 --- a/app/job/service/goods/Collector.php +++ b/app/job/service/goods/Collector.php @@ -237,7 +237,7 @@ class Collector extends BaseService unset($original['specData']); } - $form['imageStorage'] = 10; + $form['imageStorage'] = 20; // 下载远程商品图片 $original = $this->thirdPartyImages($original, $form['imageStorage'], $storeId); diff --git a/app/store/controller/Goods.php b/app/store/controller/Goods.php index 9461d65a..b6e57d4b 100644 --- a/app/store/controller/Goods.php +++ b/app/store/controller/Goods.php @@ -34,7 +34,7 @@ class Goods extends Controller // 获取列表记录 $model = new GoodsModel; $params = $this->request->param(); - //$params['channel'] = 'zy'; + $params['channel'] = 'zy'; $list= $model->getList($params, (int)$this->request->param('pageSize', 15)); return $this->renderSuccess(compact('list')); } diff --git a/app/store/model/goods/Import.php b/app/store/model/goods/Import.php index d659a49d..52097720 100644 --- a/app/store/model/goods/Import.php +++ b/app/store/model/goods/Import.php @@ -89,7 +89,16 @@ class Import extends ImportModel // $obj = new \app\job\service\goods\AdminImport(); // $service = new \app\job\service\goods\Collector(); // foreach ($execlData as $item) { - + // $info = \app\common\model\Goods::where('goods_no', $item['C'])->where('store_id', self::$storeId)->where('channel', $item['B'])->where('is_delete',0)->find(); + // // var_dump($item['C']); + // // var_dump($info); + // if ($info) { + // var_dump($info->goods_id); + // $this->successCount++; + // continue; + // } + // //var_dump($info->goods_id); + // //exit(); // $data = $obj->createData($item, self::$storeId); // $service->single($item['D'], $data, self::$storeId); // // // 记录导入成功 diff --git a/app/store/service/Upload.php b/app/store/service/Upload.php index 94a775b3..3b36be67 100644 --- a/app/store/service/Upload.php +++ b/app/store/service/Upload.php @@ -102,14 +102,16 @@ class Upload extends BaseService public function uploadByExternal(int $fileType, string $fileUrl): bool { // 文件信息 - $parseUrl = parse_url($fileUrl); + //$parseUrl = parse_url($fileUrl); + //var_dump($parseUrl); + //exit(); $fileInfo = [ 'storage' => 'external', - 'domain' => "{$parseUrl['scheme']}://{$parseUrl['host']}", - 'file_name' => basename($parseUrl['path']), - 'file_path' => ltrim($parseUrl['path'], '/'), + 'domain' => '',//"{$parseUrl['scheme']}://{$parseUrl['host']}", + 'file_name' => '',//basename($parseUrl['path']), + 'file_path' => $fileUrl, 'file_size' => 0, - 'file_ext' => pathinfo($fileUrl)['extension'], + 'file_ext' => '',//pathinfo($fileUrl)['extension'], ]; // 添加文件库记录 return $this->record($fileInfo, $fileType);