From e7275ea76563ef0b1ff3a8b87bc9226ee171a191 Mon Sep 17 00:00:00 2001 From: Mike Date: Sat, 5 Sep 2020 17:32:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0goods=20coverimg=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Model/v3/Goods.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/Model/v3/Goods.php b/app/Model/v3/Goods.php index 4c71abc..7b033d7 100644 --- a/app/Model/v3/Goods.php +++ b/app/Model/v3/Goods.php @@ -78,6 +78,15 @@ class Goods extends Model return $query->orderBy('price', $sort); } + public function getCoverImgAttribute($value) + { + if(strripos($value,"http") === false){ + return config('alioss.img_host').'/'.$value; + }else{ + return $value; + } + } + public function getMonthSalesAttribute() { $ssdb = ApplicationContext::getContainer()->get(SSDBTask::class);