diff --git a/app/Model/v3/GoodsActivity.php b/app/Model/v3/GoodsActivity.php index 7ff6a34..e6b6887 100644 --- a/app/Model/v3/GoodsActivity.php +++ b/app/Model/v3/GoodsActivity.php @@ -44,6 +44,7 @@ class GoodsActivity extends Model 'is_effective', 'noneffective_note', 'total_seconds', + 'details_imgs_url', ]; // protected $visible = [ @@ -101,4 +102,13 @@ class GoodsActivity extends Model return $this->morphMany(ShoppingCart::class, 'goods'); } + public function getDetailsImgsUrlAttribute() + { + $details_imgs = $this->details_imgs; + $img_host = config('alioss.img_host').'/'; + + return collect($details_imgs)->map(function($item) use ($img_host){ + return $img_host . $item; + }); + } } \ No newline at end of file