修改分类

This commit is contained in:
ouzhiqiang
2025-09-18 15:25:29 +08:00
parent 43c9840bf8
commit 3e6370fd51
2 changed files with 29 additions and 1 deletions

View File

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