作者 张关杰

Merge branch 'develop' of http://47.244.231.31:8099/zhl/globalso-v6 into develop

... ... @@ -55,15 +55,7 @@ class ProductLogic extends BaseLogic
$info['status_text'] = Product::statusMap()[$info['status']] ?? '';
$info['created_uid_text'] = (new UserLogic())->getCacheInfo($info['created_uid'])['name'] ?? '';
$info['url'] = $this->getProjectDomain() . $info['route'] ;
//统一图片链接
if(!empty($info['gallery'])){
$info['gallery'] = json_decode($info['gallery']);
foreach ($info['gallery'] as $k => $v){
$v = (array)$v;
$v['image_link'] = $this->getImageUrl($v['url']);
$info['gallery'][$k] = $v;
}
}
return $info;
}
... ...
... ... @@ -42,6 +42,17 @@ class Product extends Base
return $value;
}
public function setGalleryAttribute($value){
$this->attributes['gallery'] = Arr::a2s($value);
}
public function getGalleryAttribute($value){
$value = Arr::s2a($value);
foreach ($value as &$v){
$v['url'] = $this->getImageUrl($v['url']);
}
return $value;
}
/**
* @remark :图标获取器
... ...