feat: 文章相关
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user