|
|
@ -3,6 +3,7 @@ |
|
|
declare (strict_types=1); |
|
|
declare (strict_types=1); |
|
|
namespace App\Model\v3; |
|
|
namespace App\Model\v3; |
|
|
|
|
|
|
|
|
|
|
|
use App\Constants\v3\OssThumbnail; |
|
|
use App\Constants\v3\SsdbKeys; |
|
|
use App\Constants\v3\SsdbKeys; |
|
|
use App\Model\Model; |
|
|
use App\Model\Model; |
|
|
use App\Service\v3\Interfaces\AttachmentServiceInterface; |
|
|
use App\Service\v3\Interfaces\AttachmentServiceInterface; |
|
|
@ -89,7 +90,7 @@ class Goods extends Model |
|
|
|
|
|
|
|
|
public function getCoverImgAttribute($value) |
|
|
public function getCoverImgAttribute($value) |
|
|
{ |
|
|
{ |
|
|
return $this->attachmentService->switchImgToAliOss($value); |
|
|
|
|
|
|
|
|
return $this->attachmentService->switchImgToAliOss($value, OssThumbnail::THUMBNAIL_600_Q90); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public function getMonthSalesAttribute() |
|
|
public function getMonthSalesAttribute() |
|
|
@ -117,10 +118,9 @@ class Goods extends Model |
|
|
public function getDetailsImgsUrlAttribute() |
|
|
public function getDetailsImgsUrlAttribute() |
|
|
{ |
|
|
{ |
|
|
$details_imgs = $this->details_imgs; |
|
|
$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; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return collect($details_imgs)->map(function($item) { |
|
|
|
|
|
return $this->attachmentService->switchImgToAliOss($item); |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|