作者 lyh

ggx

... ... @@ -39,33 +39,33 @@ class Product extends Base
3=>'热销产品'
];
public function setThumbAttribute($value){
$value['url'] = str_replace_url($value['url']);
$this->attributes['thumb'] = Arr::a2s($value);
}
public function getThumbAttribute($value){
$value = json_decode($value,true);
$value['url'] = getImageUrl($value['url']);
return $value;
}
public function setGalleryAttribute($value){
foreach ($value as $k => $v){
$v['url'] = str_replace_url($v['url']);
$value[$k] = $v;
}
$this->attributes['gallery'] = Arr::a2s($value);
}
public function getGalleryAttribute($value){
$value = Arr::s2a($value);
foreach ($value as $k => $v){
$v['url'] = getImageUrl($v['url']);
$value[$k] = $v;
}
return $value;
}
// public function setThumbAttribute($value){
// $value['url'] = str_replace_url($value['url']);
// $this->attributes['thumb'] = Arr::a2s($value);
// }
//
// public function getThumbAttribute($value){
// $value = json_decode($value,true);
// $value['url'] = getImageUrl($value['url']);
// return $value;
// }
//
// public function setGalleryAttribute($value){
// foreach ($value as $k => $v){
// $v['url'] = str_replace_url($v['url']);
// $value[$k] = $v;
// }
// $this->attributes['gallery'] = Arr::a2s($value);
// }
//
// public function getGalleryAttribute($value){
// $value = Arr::s2a($value);
// foreach ($value as $k => $v){
// $v['url'] = getImageUrl($v['url']);
// $value[$k] = $v;
// }
// return $value;
// }
// /**
// * @remark :图标获取器
... ...