pull/1/head
lqmac 1 year ago
parent 8f9da1ac26
commit 29d6efd82e
  1. 4
      app/api/controller/Index.php

@ -18,8 +18,8 @@ class Index extends Controller
public function getBannerList(){ public function getBannerList(){
$list = Banner::where("status", 10)->select()->toArray(); $list = Banner::where("status", 10)->select()->toArray();
foreach ($list as &$value) { foreach ($list as &$value) {
$file_path = UploadFile::where('file_id', $value['image_id'])->field('file_path')->find()->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); $value['image'] = getUrl($file_path['file_path'], $file_path['domain']);
} }
return $this->renderSuccess($list); return $this->renderSuccess($list);
} }

Loading…
Cancel
Save