feat: 文章相关

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

View File

@@ -29,9 +29,9 @@ class ArticleModel extends ArticleBaseModel
return $query->where('recommend', '=', (int)$stat);
}
// 启用状态范围查询
public function scopeEnabled($query, bool $stat = true)
// 文章分类范围查询
public function scopeCategory($query, $category)
{
return $query->where('enabled', '=', (int)$stat);
return $query->where('category_id', '=', $category);
}
}