|
|
|
@ -2,6 +2,7 @@ |
|
|
|
|
|
|
|
namespace App\Model\v3; |
|
|
|
|
|
|
|
use App\Constants\v3\OssThumbnail; |
|
|
|
use App\Model\Model; |
|
|
|
use Hyperf\Database\Model\Builder; |
|
|
|
use Hyperf\Database\Model\SoftDeletes; |
|
|
|
@ -18,11 +19,10 @@ class GoodsActivityBanner extends Model |
|
|
|
|
|
|
|
public function getBannerUrlAttribute() |
|
|
|
{ |
|
|
|
$url = $this->attributes['path']; |
|
|
|
if(strripos($url,"http") === false){ |
|
|
|
return config('alioss.img_host').'/'.$url; |
|
|
|
}else{ |
|
|
|
return $url; |
|
|
|
if ($this->attributes['type'] == 1) { |
|
|
|
return $this->attachmentService->switchImgToAliOss($this->attributes['path'], OssThumbnail::THUMBNAIL_600_Q90); |
|
|
|
} elseif ($this->attributes['type'] == 2) { |
|
|
|
return $this->attachmentService->switchImgToAliOss($this->attributes['path']); |
|
|
|
} |
|
|
|
} |
|
|
|
} |