From 201aaf76c2672f5fceeef6f80647c5ad9f37c4fc Mon Sep 17 00:00:00 2001 From: tianshujie Date: Fri, 18 Feb 2022 15:48:37 +0800 Subject: [PATCH] * Fix playback video issue. --- module/file/model.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/module/file/model.php b/module/file/model.php index ce16cf9ba1..6f080e209e 100644 --- a/module/file/model.php +++ b/module/file/model.php @@ -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->getWebRoot() . 'data/course/' . $file->pathname; } } @@ -80,10 +80,18 @@ class fileModel extends model { $file = $this->dao->findById($fileID)->from(TABLE_FILE)->fetch(); if(empty($file)) return false; + 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->getWebRoot() . 'data/course/' . $file->pathname; + } - $realPathName = $this->getRealPathName($file->pathname); - $file->realPath = $this->savePath . $realPathName; - $file->webPath = $this->webPath . $realPathName; return $file; }