Browse Source

上次图片图片信息存在不重复保存

master
wanghongjun 8 months ago
parent
commit
e37ffa3b0d
  1. 6
      app/common/controller/Upload.php

6
app/common/controller/Upload.php

@ -158,6 +158,9 @@ class Upload extends BaseController
if (isset($saveData['type'])) { if (isset($saveData['type'])) {
unset($saveData['type']); unset($saveData['type']);
} }
if (isset($saveData['videoInfo'])) {
unset($saveData['videoInfo']);
}
$exists = $fileInfo->where($saveData)->find(); $exists = $fileInfo->where($saveData)->find();
if (!$exists) { if (!$exists) {
$fileInfo->save($saveData); $fileInfo->save($saveData);
@ -382,6 +385,9 @@ class Upload extends BaseController
if (isset($saveInfo['type'])) { if (isset($saveInfo['type'])) {
unset($saveInfo['type']); unset($saveInfo['type']);
} }
if (isset($saveInfo['videoInfo'])) {
unset($saveInfo['videoInfo']);
}
$exists = $fileInfo->where($saveInfo)->find(); $exists = $fileInfo->where($saveInfo)->find();
if (!$exists) { if (!$exists) {
$fileInfo->save($saveInfo); $fileInfo->save($saveInfo);

Loading…
Cancel
Save