From 5f26d67f7d089de9fc8c6292b21a76c3defb9ebd Mon Sep 17 00:00:00 2001 From: Mike Date: Sat, 5 Sep 2020 16:24:55 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix=20=E9=A6=96=E9=A1=B5=E5=88=86=E7=B1=BBi?= =?UTF-8?q?con=20dcat=E6=95=B0=E6=8D=AE=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Service/v3/Implementations/CategoryService.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Service/v3/Implementations/CategoryService.php b/app/Service/v3/Implementations/CategoryService.php index b7195e2..e2aeda0 100644 --- a/app/Service/v3/Implementations/CategoryService.php +++ b/app/Service/v3/Implementations/CategoryService.php @@ -60,7 +60,7 @@ class CategoryService implements CategoryServiceInterface $value = json_decode($category, true); $iconUrl = $value['icon']; if(strripos($iconUrl,"http") === false){ - $iconUrl = config('alioss.img_host').$value['icon']; + $iconUrl = config('alioss.img_host').'/'.$value['icon']; } $iconUrl = $iconUrl . OssThumbnail::THUMBNAIL_100_Q50; $returnData[] = ['id' => $key, 'icon' => $iconUrl , 'name' => $value['name']]; From b29104d4943f23b678995f0d87d396957b6f1fbb Mon Sep 17 00:00:00 2001 From: Mike Date: Sat, 5 Sep 2020 16:38:55 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=B7=BB=E5=8A=A0bannerUrl?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Model/v3/GoodsBanner.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/app/Model/v3/GoodsBanner.php b/app/Model/v3/GoodsBanner.php index 598e031..37d33cd 100644 --- a/app/Model/v3/GoodsBanner.php +++ b/app/Model/v3/GoodsBanner.php @@ -10,4 +10,19 @@ class GoodsBanner extends Model { use SoftDeletes; protected $table = 'lanzu_goods_banners'; + + protected $appends = [ + 'banner_url', + ]; + + + public function getBannerUrlAttribute() + { + $url = $this->attributes['path']; + if(strripos($url,"http") === false){ + return config('alioss.img_host').'/'.$url; + }else{ + return $url; + } + } } \ No newline at end of file