作者 lyh

gx

... ... @@ -4,9 +4,7 @@ namespace App\Models\Product;
use App\Helper\Arr;
use App\Models\Base;
use App\Models\File\Image;
use App\Models\RouteMap;
use App\Services\CosService;
use App\Services\Facades\Upload;
use Illuminate\Database\Eloquent\SoftDeletes;
... ... @@ -35,7 +33,7 @@ class Product extends Base
}
public function setThumbAttribute($value){
$value['url'] = $this->getImageUrl($value['url']);
$value['url'] = Upload::url2path($value['url']);
$this->attributes['thumb'] = Arr::a2s($value);
}
... ... @@ -47,7 +45,7 @@ class Product extends Base
public function setGalleryAttribute($value){
foreach ($value as &$v){
$v['url'] = $this->getImageUrl($value['url']);
$v['url'] = Upload::url2path($v['url']);
}
$this->attributes['gallery'] = Arr::a2s($value);
}
... ... @@ -55,7 +53,7 @@ class Product extends Base
public function getGalleryAttribute($value){
$value = Arr::s2a($value);
foreach ($value as &$v){
$v['url'] = $this->getImageUrl($value['url']);
$v['url'] = Upload::path2url($v['url']);
}
return $value;
}
... ...