<?php

namespace App\Models;

use Dcat\Admin\Traits\HasDateTimeFormatter;
use Illuminate\Database\Eloquent\Model;

class Banner extends Model
{
    use HasDateTimeFormatter;
    protected $table    = 'banner';
    protected $fillable = ['title', 'sort', 'url', 'state', 'image_path'];
    public function getImagePathAttribute($value)
    {
        if(!strstr($value, 'https')) {
            return 'https://zhengda.oss-cn-chengdu.aliyuncs.com/'.$value;
        }
        return $value;
    }
}
