* Modify the path to get the file.

This commit is contained in:
tianshujie
2022-02-15 15:16:14 +08:00
parent 8dc7ece5b4
commit c44dfa1788
+13 -3
View File
@@ -50,12 +50,22 @@ class fileModel extends model
->beginIF($extra)->andWhere('extra')->eq($extra)
->orderBy('id')
->fetchAll('id');
foreach($files as $file)
{
$realPathName = $this->getRealPathName($file->pathname);
$file->realPath = $this->savePath . $realPathName;
$file->webPath = $this->webPath . $realPathName;
if($objectType != 'traincourse' and $objectType != 'traincontents')
{
$realPathName = $this->getRealPathName($file->pathname);
$file->realPath = $this->savePath . $realPathName;
$file->webPath = $this->webPath . $realPathName;
}
else
{
$file->realPath = $this->app->getWwwRoot() . 'data/course/' . $file->pathname;
$file->webPath = '/data/course/' . $file->pathname;
}
}
return $files;
}