作者 lyh

gx

@@ -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 - $imageModel = new Image();  
150 - $info = $imageModel->read(['hash'=>$hash]);  
151 - $url = '';  
152 - if($info['is_cos'] == 1){  
153 - $cos = new CosService();  
154 - $url = $cos->getImageUrl($info['path']); 149 + if(is_array($hash)){
  150 + foreach ($hash as $k => $v){
  151 + $url[] = $this->getImageUrl($v);
  152 + }
155 }else{ 153 }else{
156 - $url = url('a/image/'.$info['hash']); 154 + $imageModel = new Image();
  155 + $info = $imageModel->read(['hash'=>$hash]);
  156 + if($info['is_cos'] == 1){
  157 + $cos = new CosService();
  158 + $url = $cos->getImageUrl($info['path']);
  159 + }else{
  160 + $url = url('a/image/'.$info['hash']);
  161 + }
157 } 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){