Browse Source

fix:修复上传逻辑,在未修改文件的情况下,更新操作时会将图片删除bug

antshop
linyaostalker 5 years ago
parent
commit
ce2fd0326f
  1. 4
      backend/modules/file/logic/file/FileManager.php

4
backend/modules/file/logic/file/FileManager.php

@ -146,12 +146,10 @@ class FileManager
$fileNewIdStr = $dataModel->$fileIdStrName; $fileNewIdStr = $dataModel->$fileIdStrName;
$dataModel->save(); $dataModel->save();
$saveFileRes = GoodsManager::saveFile(explode(',', $fileNewIdStr), $dataModel, explode(',', $fileOldIdStr), $fileType); $saveFileRes = GoodsManager::saveFile(explode(',', $fileNewIdStr), $dataModel, explode(',', $fileOldIdStr), $fileType);
if ($fileNameInModel) {
if ($saveFileRes['status']) {
if ($fileNameInModel && $saveFileRes['status'] && $saveFileRes['first_file_id']) {
$dataModel->$fileNameInModel = $saveFileRes['first_file_id']; $dataModel->$fileNameInModel = $saveFileRes['first_file_id'];
$dataModel->save(); $dataModel->save();
} }
}
return true; return true;
} }

Loading…
Cancel
Save