diff --git a/app/api/controller/Index.php b/app/api/controller/Index.php index 0617f39b..2f053aa9 100644 --- a/app/api/controller/Index.php +++ b/app/api/controller/Index.php @@ -18,8 +18,8 @@ class Index extends Controller public function getBannerList(){ $list = Banner::where("status", 10)->select()->toArray(); foreach ($list as &$value) { - $file_path = UploadFile::where('file_id', $value['image_id'])->field('file_path')->find()->file_path; - $value['image'] = getUrl($file_path); + $file_path = UploadFile::where('file_id', $value['image_id'])->field('file_id,file_path,file_type,storage,domain')->find(); + $value['image'] = getUrl($file_path['file_path'], $file_path['domain']); } return $this->renderSuccess($list); }