30 lines
573 B
PHP
30 lines
573 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Dcat\Admin\Traits\HasDateTimeFormatter;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Ad extends Model
|
|
{
|
|
use Concerns\HasShowable;
|
|
use HasDateTimeFormatter;
|
|
|
|
protected $fillable = ['address_id', 'image', 'sort', 'jump_type', 'jump_link', 'is_show', 'name', 'remarks'];
|
|
|
|
/**
|
|
* @var array
|
|
*/
|
|
protected $casts = [
|
|
'is_show' => 'bool',
|
|
];
|
|
|
|
/**
|
|
* 此广告所属的广告位
|
|
*/
|
|
public function address()
|
|
{
|
|
return $this->belongsTo(AdAddress::class, 'address_id');
|
|
}
|
|
}
|