作者 lyh

gx

@@ -64,6 +64,15 @@ class ProductLogic extends BaseLogic @@ -64,6 +64,15 @@ class ProductLogic extends BaseLogic
64 $info['gallery'][$k] = $v; 64 $info['gallery'][$k] = $v;
65 } 65 }
66 } 66 }
  67 + //图标
  68 + if(!empty($info['icon'])){
  69 + $info['icon'] = json_decode($info['icon']);
  70 + foreach ($info['icon'] as $k => $v){
  71 + $v = (array)$v;
  72 + $v['image_link'] = $this->getImageUrl($v['url']);
  73 + $info['icon'][$k] = $v;
  74 + }
  75 + }
67 return $info; 76 return $info;
68 } 77 }
69 78
@@ -43,17 +43,6 @@ class Product extends Base @@ -43,17 +43,6 @@ class Product extends Base
43 } 43 }
44 44
45 45
46 -// /**  
47 -// * @remark :图标获取器  
48 -// * @name :getGalleryAttribute  
49 -// * @author :lyh  
50 -// * @method :post  
51 -// * @time :2023/7/21 11:11  
52 -// */  
53 -// public function setIconAttribute($value){  
54 -// $this->attributes['icon'] = Arr::a2s($value);  
55 -// }  
56 -  
57 /** 46 /**
58 * @remark :图标获取器 47 * @remark :图标获取器
59 * @name :getGalleryAttribute 48 * @name :getGalleryAttribute
@@ -61,14 +50,11 @@ class Product extends Base @@ -61,14 +50,11 @@ class Product extends Base
61 * @method :post 50 * @method :post
62 * @time :2023/7/21 11:11 51 * @time :2023/7/21 11:11
63 */ 52 */
64 - public function getIconAttribute($value){  
65 - $value = Arr::s2a($value);  
66 - foreach ($value as &$v){  
67 - $v = $this->getImageUrl($v);  
68 - }  
69 - return $value; 53 + public function setIconAttribute($value){
  54 + $this->attributes['icon'] = Arr::a2s($value);
70 } 55 }
71 56
  57 +
72 public function setAttrsAttribute($value){ 58 public function setAttrsAttribute($value){
73 $this->attributes['attrs'] = Arr::a2s($value); 59 $this->attributes['attrs'] = Arr::a2s($value);
74 } 60 }