Browse Source

Merge branch 'phoenix' of http://120.24.33.109:11081/hyzjshwo/lanzu_api_hyperf into phoenix

master
Lemon 6 years ago
parent
commit
19ea857aec
  1. 15
      app/Model/v3/GoodsBanner.php
  2. 2
      app/Service/v3/Implementations/CategoryService.php

15
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;
}
}
}

2
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']];

Loading…
Cancel
Save