From d318fd4e4fc49fcb14fa2b336a7ccf3c98c2d037 Mon Sep 17 00:00:00 2001 From: Lemon <15040771@qq.com> Date: Mon, 26 Oct 2020 16:20:09 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86=E5=9B=BE=E7=89=87=E4=B8=BB?= =?UTF-8?q?=E5=9B=BE=E4=B8=BA=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Model/v3/Goods.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/Model/v3/Goods.php b/app/Model/v3/Goods.php index 13e4411..7ee3cf8 100644 --- a/app/Model/v3/Goods.php +++ b/app/Model/v3/Goods.php @@ -109,7 +109,11 @@ class Goods extends Model public function getCoverImgAttribute($value) { - return $this->attachmentService->switchImgToAliOss($value, OssThumbnail::THUMBNAIL_600_Q90); + if(!empty($value)) { + return $this->attachmentService->switchImgToAliOss($value, OssThumbnail::THUMBNAIL_600_Q90); + }else{ + return ''; + } } public function getMonthSalesAttribute()