作者 lyh

gx

@@ -56,7 +56,7 @@ class ProductFileUpload extends Command @@ -56,7 +56,7 @@ class ProductFileUpload extends Command
56 $code = $this->synchronizationFile($url,$newName); 56 $code = $this->synchronizationFile($url,$newName);
57 if((int)$code == 200){ 57 if((int)$code == 200){
58 echo date('Y-m-d H:i:s') . '编辑的path为:'. $url .',主键id:'. $v['id'] . PHP_EOL; 58 echo date('Y-m-d H:i:s') . '编辑的path为:'. $url .',主键id:'. $v['id'] . PHP_EOL;
59 - $v['files']['url'] = $newName; 59 + $v['files']['url'] = preg_replace('#/[^/]*$#', '/', $url).$newName;
60 $productModel->edit(['files'=>json_encode($v['files'])],['id'=>$v['id']]); 60 $productModel->edit(['files'=>json_encode($v['files'])],['id'=>$v['id']]);
61 } 61 }
62 } 62 }