* Modify course playback path.

This commit is contained in:
tianshujie
2022-02-24 12:11:45 +08:00
parent 22147a542c
commit f7f9450c79
+12 -4
View File
@@ -62,7 +62,7 @@ class fileModel extends model
else
{
$file->realPath = $this->app->getWwwRoot() . 'data/course/' . $file->pathname;
$file->webPath = '/data/course/' . $file->pathname;
$file->webPath = $this->app->getWwwRoot() . 'data/course/' . $file->pathname;
}
}
@@ -81,9 +81,17 @@ class fileModel extends model
$file = $this->dao->findById($fileID)->from(TABLE_FILE)->fetch();
if(empty($file)) return false;
$realPathName = $this->getRealPathName($file->pathname);
$file->realPath = $this->savePath . $realPathName;
$file->webPath = $this->webPath . $realPathName;
if($file->objectType != 'traincourse' and $file->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 = $this->app->getWwwRoot() . 'data/course/' . $file->pathname;
}
return $file;
}