diff --git a/app/Models/LanzuGoods.php b/app/Models/LanzuGoods.php index 163d2f2..c18e508 100644 --- a/app/Models/LanzuGoods.php +++ b/app/Models/LanzuGoods.php @@ -4,6 +4,7 @@ namespace App\Models; use Illuminate\Database\Eloquent\Model; use Laravel\Scout\Searchable; +use Illuminate\Support\Str; class LanzuGoods extends Model { @@ -12,6 +13,13 @@ class LanzuGoods extends Model protected $table = 'lanzu_goods'; protected $dateFormat = 'U'; + public function getCoverImgAttribute($v){ + if(Str::startsWith($v,"http")){ + return $v; + }else{ + return env('IMG_HOST') . $v; + } + } public function searchableAs() {