* fix #1843
Remove categroy name-exists detecting

* detect category-exists only in the same level
This commit is contained in:
joyqi 2025-01-13 16:48:46 +08:00 committed by GitHub
parent b989f24c5b
commit 8035b22347
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -56,6 +56,7 @@ class Edit extends Metas implements ActionInterface
/**
* 判断分类名称是否存在
* fix #1843 将重复性判断限制在同一父分类下
*
* @param string $name 分类名称
* @return boolean
@ -73,6 +74,9 @@ class Edit extends Metas implements ActionInterface
$select->where('mid <> ?', $this->request->get('mid'));
}
// 只在同一父分类下判断重复性
$select->where('parent = ?', $this->request->filter('int')->get('parent', 0));
$category = $this->db->fetchRow($select);
return !$category;
}