正在显示
1 个修改的文件
包含
1 行增加
和
1 行删除
| @@ -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 | } |
-
请 注册 或 登录 后发表评论