海南旅游SAAS
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
668 B

  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Factories\HasFactory;
  4. use Illuminate\Database\Eloquent\SoftDeletes;
  5. /**
  6. * 频道列表
  7. * Class Channel
  8. * @package App\Models
  9. */
  10. class Channel extends BaseModel
  11. {
  12. use HasFactory, SoftDeletes;
  13. public function __construct(array $attributes = [])
  14. {
  15. parent::__construct($attributes);
  16. $this->timestamps = false;
  17. }
  18. public function getIconAttribute($value): string
  19. {
  20. return $value ? $this->host . $value : '';
  21. }
  22. public function setIconAttribute($value)
  23. {
  24. //修改器里面$this->host变量为空
  25. $this->attributes['license_pic'] = str_replace(env('APP_URL'), '', $value);
  26. }
  27. }