Merge branch 'release/21.7.2' into feature/performance

This commit is contained in:
wangyidong
2025-06-03 13:59:53 +08:00
207 changed files with 11495 additions and 4008 deletions
+2 -2
View File
@@ -1568,12 +1568,12 @@ class docModel extends model
}
$files = $this->loadModel('file')->getUpload();
if($doc->type == 'attachment' && (empty($files) || isset($files['name']))) return dao::$errors['files'] = sprintf($this->lang->error->notempty, $this->lang->doc->uploadFile);
if($doc->type == 'attachment' && empty($doc->copy) && (empty($files) || isset($files['name']))) return dao::$errors['files'] = sprintf($this->lang->error->notempty, $this->lang->doc->uploadFile);
$doc->draft = $isDraft ? $docContent->content : '';
$doc->vision = $this->config->vision;
$doc->version = $isDraft ? 0 : 1;
$this->dao->insert(TABLE_DOC)->data($doc, 'content')->autoCheck()->batchCheck($requiredFields, 'notempty')->exec();
$this->dao->insert(TABLE_DOC)->data($doc, 'content,copy')->autoCheck()->batchCheck($requiredFields, 'notempty')->exec();
if(dao::isError()) return false;
$docID = $this->dao->lastInsertID();