作者 lyh

gx

@@ -40,6 +40,14 @@ class ProductLogic extends BaseLogic @@ -40,6 +40,14 @@ class ProductLogic extends BaseLogic
40 { 40 {
41 $info = $this->model->read(['id'=>$id]); 41 $info = $this->model->read(['id'=>$id]);
42 $info = $this->formatData($info); 42 $info = $this->formatData($info);
  43 + //统一图片链接
  44 + if(!empty($info['gallery'])){
  45 + foreach ($info['gallery'] as $k => $v){
  46 + $v['image_link'] = $this->getImageUrl($v['url']);
  47 + $info['gallery'][$k] = $v;
  48 + }
  49 + }
  50 + $info['icon_link'] = $this->getImageUrl($info['icon']);
43 return $this->success($info); 51 return $this->success($info);
44 } 52 }
45 53
@@ -55,14 +63,6 @@ class ProductLogic extends BaseLogic @@ -55,14 +63,6 @@ class ProductLogic extends BaseLogic
55 $info['status_text'] = Product::statusMap()[$info['status']] ?? ''; 63 $info['status_text'] = Product::statusMap()[$info['status']] ?? '';
56 $info['created_uid_text'] = (new UserLogic())->getCacheInfo($info['created_uid'])['name'] ?? ''; 64 $info['created_uid_text'] = (new UserLogic())->getCacheInfo($info['created_uid'])['name'] ?? '';
57 $info['url'] = $this->getProjectDomain() . $info['route'] ; 65 $info['url'] = $this->getProjectDomain() . $info['route'] ;
58 - //统一图片链接  
59 - if(!empty($info['gallery'])){  
60 - foreach ($info['gallery'] as $k => $v){  
61 - $v['image_link'] = $this->getImageUrl($v['url']);  
62 - $info['gallery'][$k] = $v;  
63 - }  
64 - }  
65 - $info['icon_link'] = $this->getImageUrl($info['icon']);  
66 return $info; 66 return $info;
67 } 67 }
68 68