fix: 文章详情推荐文章

This commit is contained in:
2025-06-24 14:13:55 +08:00
parent 9a988de538
commit 06b5d445f7
3 changed files with 22 additions and 1 deletions

View File

@@ -46,6 +46,17 @@ class ArticleCategoryModel extends ArticleCategoryBaseModel
$query->where('pid', '=', $parent);
}
// 所属子分类范围查询
public function scopeChild($query, $id, $merge_self = false)
{
$query->where(function($q) use($id, $merge_self) {
$q->where('pid', '=', $id);
if ($merge_self) {
$q->whereOr('id', '=', $id);
}
});
}
// 是否显示状态范围查询
public function scopeIsShow($query, bool $is_show)
{