修改分类

This commit is contained in:
ouzhiqiang
2025-09-19 11:37:41 +08:00
parent 5d61b4995f
commit 2dc787bbfd
2 changed files with 12 additions and 2 deletions

View File

@@ -56,6 +56,16 @@ class ArticleCategoryModel extends ArticleCategoryBaseModel
$query->where('pid', '=', $parent);
}
// 所属上级分类查询
public function scopeParentColumn($query, $parent)
{
if (is_array($parent)) {
$query->where('id', 'IN', $parent);
return;
}
$query->where('id', '=', $parent);
}
// 所属子分类范围查询
public function scopeChild($query, $id, $merge_self = false)