es
lqmac 7 months ago
parent 6ef632e489
commit 030c415343
  1. 2
      app/job/service/goods/AdminImport.php
  2. 2
      app/job/service/goods/Collector.php
  3. 2
      app/store/controller/Goods.php
  4. 11
      app/store/model/goods/Import.php
  5. 12
      app/store/service/Upload.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,

@ -237,7 +237,7 @@ class Collector extends BaseService
unset($original['specData']);
}
$form['imageStorage'] = 10;
$form['imageStorage'] = 20;
// 下载远程商品图片
$original = $this->thirdPartyImages($original, $form['imageStorage'], $storeId);

@ -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'));
}

@ -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);
// // // 记录导入成功

@ -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);

Loading…
Cancel
Save