* Add function setFielAndRealPaths to file model.

This commit is contained in:
wangjianhua
2022-11-09 23:28:37 +08:00
parent fc4302e603
commit cd5749835e
8 changed files with 91 additions and 44 deletions
+2 -1
View File
@@ -616,6 +616,7 @@ class doc extends control
*/
public function delete($docID, $confirm = 'no', $from = 'list')
{
$this->loadModel('file');
if($confirm == 'no')
{
$type = $this->dao->select('type')->from(TABLE_DOC)->where('id')->eq($docID)->fetch('type');
@@ -637,7 +638,7 @@ class doc extends control
$this->loadModel('action')->create($file->objectType, $file->objectID, 'deletedFile', '', $extra=$file->title);
$fileRecord = $this->dao->select('id')->from(TABLE_FILE)->where('pathname')->eq($file->pathname)->fetch();
if(empty($fileRecord)) @unlink($file->realPath);
if(empty($fileRecord)) $this->file->unlinkFile($file);
}
/* if ajax request, send result. */