作者 lyh

gx

... ... @@ -146,15 +146,21 @@ class BaseController extends Controller
* @time :2023/7/20 16:46
*/
public function getImageUrl($hash){
$imageModel = new Image();
$info = $imageModel->read(['hash'=>$hash]);
$url = '';
if($info['is_cos'] == 1){
$cos = new CosService();
$url = $cos->getImageUrl($info['path']);
if(is_array($hash)){
foreach ($hash as $k => $v){
$url[] = $this->getImageUrl($v);
}
}else{
$url = url('a/image/'.$info['hash']);
$imageModel = new Image();
$info = $imageModel->read(['hash'=>$hash]);
if($info['is_cos'] == 1){
$cos = new CosService();
$url = $cos->getImageUrl($info['path']);
}else{
$url = url('a/image/'.$info['hash']);
}
}
return $url;
}
... ...
... ... @@ -17,8 +17,14 @@ class HrController extends BaseController
*/
public function list(HrLogic $logic)
{
$list = $logic->getHrList($this->map,$this->page,$this->row,$this->order);
return $this->response('success', Code::SUCCESS, $list);
$lists = $logic->getHrList($this->map,$this->page,$this->row,$this->order);
if(!empty($lists['list'])){
foreach ($lists['list'] as $k => $v){
$v['photo_gallery_link'] = $this->getImageUrl($v['photo_gallery']);
$lists['list'][$k] = $v;
}
}
return $this->response('success', Code::SUCCESS, $lists);
}
public function info(Request $request, HrLogic $logic){
... ...