Browse Source

Merge branch 'phoenix' of ssh://120.24.33.109:11022/hyzjshwo/lanzu_api_hyperf into phoenix

master
weigang 5 years ago
parent
commit
affa9480da
  1. 14
      app/Model/v3/Category.php

14
app/Model/v3/Category.php

@ -13,7 +13,8 @@ class Category extends Model
protected $table = 'lanzu_category';
protected $appends = [
'goods_types'
'goods_types',
'cover_url'
];
protected function boot(): void
@ -28,4 +29,15 @@ class Category extends Model
{
return self::query()->where(['parent_id' => $this->attributes['id']])->orderBy('sort', 'desc')->get()->toArray();
}
public function getCoverUrlAttribute()
{
$url = $this->attributes['cover_img'];
if(strripos($url,"http") === false){
return config('alioss.img_host').'/'.$url;
}else{
return $url;
}
}
}
Loading…
Cancel
Save