正在显示
2 个修改的文件
包含
15 行增加
和
3 行删除
| @@ -146,15 +146,21 @@ class BaseController extends Controller | @@ -146,15 +146,21 @@ class BaseController extends Controller | ||
| 146 | * @time :2023/7/20 16:46 | 146 | * @time :2023/7/20 16:46 |
| 147 | */ | 147 | */ |
| 148 | public function getImageUrl($hash){ | 148 | public function getImageUrl($hash){ |
| 149 | + if(is_array($hash)){ | ||
| 150 | + foreach ($hash as $k => $v){ | ||
| 151 | + $url[] = $this->getImageUrl($v); | ||
| 152 | + } | ||
| 153 | + }else{ | ||
| 149 | $imageModel = new Image(); | 154 | $imageModel = new Image(); |
| 150 | $info = $imageModel->read(['hash'=>$hash]); | 155 | $info = $imageModel->read(['hash'=>$hash]); |
| 151 | - $url = ''; | ||
| 152 | if($info['is_cos'] == 1){ | 156 | if($info['is_cos'] == 1){ |
| 153 | $cos = new CosService(); | 157 | $cos = new CosService(); |
| 154 | $url = $cos->getImageUrl($info['path']); | 158 | $url = $cos->getImageUrl($info['path']); |
| 155 | }else{ | 159 | }else{ |
| 156 | $url = url('a/image/'.$info['hash']); | 160 | $url = url('a/image/'.$info['hash']); |
| 157 | } | 161 | } |
| 162 | + } | ||
| 163 | + | ||
| 158 | return $url; | 164 | return $url; |
| 159 | } | 165 | } |
| 160 | 166 |
| @@ -17,8 +17,14 @@ class HrController extends BaseController | @@ -17,8 +17,14 @@ class HrController extends BaseController | ||
| 17 | */ | 17 | */ |
| 18 | public function list(HrLogic $logic) | 18 | public function list(HrLogic $logic) |
| 19 | { | 19 | { |
| 20 | - $list = $logic->getHrList($this->map,$this->page,$this->row,$this->order); | ||
| 21 | - return $this->response('success', Code::SUCCESS, $list); | 20 | + $lists = $logic->getHrList($this->map,$this->page,$this->row,$this->order); |
| 21 | + if(!empty($lists['list'])){ | ||
| 22 | + foreach ($lists['list'] as $k => $v){ | ||
| 23 | + $v['photo_gallery_link'] = $this->getImageUrl($v['photo_gallery']); | ||
| 24 | + $lists['list'][$k] = $v; | ||
| 25 | + } | ||
| 26 | + } | ||
| 27 | + return $this->response('success', Code::SUCCESS, $lists); | ||
| 22 | } | 28 | } |
| 23 | 29 | ||
| 24 | public function info(Request $request, HrLogic $logic){ | 30 | public function info(Request $request, HrLogic $logic){ |
-
请 注册 或 登录 后发表评论