From c44dfa178814b685a9c5c280b9cec0eb799c8f68 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Tue, 15 Feb 2022 15:16:14 +0800 Subject: [PATCH] * Modify the path to get the file. --- module/file/model.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/module/file/model.php b/module/file/model.php index a287289f3e..ce16cf9ba1 100644 --- a/module/file/model.php +++ b/module/file/model.php @@ -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; }