fix: 文章详情推荐文章
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user