作者 lyh

gx

... ... @@ -64,15 +64,6 @@ class ProductLogic extends BaseLogic
$info['gallery'][$k] = $v;
}
}
//图标
if(!empty($info['icon'])){
$info['icon'] = json_decode($info['icon']);
foreach ($info['icon'] as $k => $v){
var_dump($v);
die();
$info[] = $this->getImageUrl($v);
}
}
return $info;
}
... ...
... ... @@ -54,6 +54,20 @@ class Product extends Base
$this->attributes['icon'] = Arr::a2s($value);
}
/**
* @remark :图标获取器
* @name :getGalleryAttribute
* @author :lyh
* @method :post
* @time :2023/7/21 11:11
*/
public function getIconAttribute($value){
$value = Arr::s2a($value);
foreach ($value as &$v){
$v = $this->getImageUrl($v);
}
return $value;
}
public function setAttrsAttribute($value){
$this->attributes['attrs'] = Arr::a2s($value);
... ...