feat: 文章相关

This commit is contained in:
2025-04-12 14:34:07 +08:00
parent a5195b01e9
commit bbdc2977f7
7 changed files with 123 additions and 82 deletions

View File

@@ -17,6 +17,18 @@ class SysBannerItemModel extends SysBannerItemBaseModel
// 软删除字段
protected $deleteTime = 'deleted_at';
// 关联分类
public function banner()
{
return $this->hasOne(SysBannerModel::class, 'id', 'banner_id');
}
// 类型范围查询
public function scopeType($query, $type)
{
$query->where('type', '=', $type);
}
// 启用状态范围查询
public function scopeEnabled($query)
{