作者 lyh

gx

@@ -48,16 +48,19 @@ class ProductFileUpload extends Command @@ -48,16 +48,19 @@ class ProductFileUpload extends Command
48 $url = str_replace_url($v['files']['url']); 48 $url = str_replace_url($v['files']['url']);
49 //获取当前图片的原名称 49 //获取当前图片的原名称
50 $files = new File(); 50 $files = new File();
51 - $fileInfo = $files->read(['path'=>$url]); 51 + $fileInfo = $files->read(['path'=>$url,'project_id'=>$project_id]);
52 if($fileInfo === false){ 52 if($fileInfo === false){
53 continue; 53 continue;
54 } 54 }
55 $newName = $fileInfo['name']; 55 $newName = $fileInfo['name'];
56 - $this->synchronizationFile($url,$newName); 56 + $code = $this->synchronizationFile($url,$newName);
  57 + if((int)$code == 200){
  58 + echo date('Y-m-d H:i:s') . '编辑的path为:'. $url .',主键id:'. $v['id'] . PHP_EOL;
57 $v['files']['url'] = $newName; 59 $v['files']['url'] = $newName;
58 $productModel->edit(['files'=>json_encode($v['files'])],['id'=>$v['id']]); 60 $productModel->edit(['files'=>json_encode($v['files'])],['id'=>$v['id']]);
59 } 61 }
60 } 62 }
  63 + }
61 DB::disconnect('custom_mysql'); 64 DB::disconnect('custom_mysql');
62 } 65 }
63 66