From a3fc3f85be9c72c0080370608dbe9dc333fe10a8 Mon Sep 17 00:00:00 2001 From: saynone <5660782@qq.com> Date: Tue, 26 Nov 2019 14:38:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=88=86=E7=B1=BB=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E4=B8=AD=E5=8F=AF=E5=B0=86=E7=88=B6id=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E4=B8=BA=E8=87=AA=E5=B7=B1=E7=9A=84=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/controller/Category.php | 4 ++-- application/admin/lang/zh-cn/category.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/application/admin/controller/Category.php b/application/admin/controller/Category.php index c2d488277..306320fca 100644 --- a/application/admin/controller/Category.php +++ b/application/admin/controller/Category.php @@ -102,9 +102,9 @@ class Category extends Backend $params = $this->preExcludeFields($params); if ($params['pid'] != $row['pid']) { - $childrenIds = Tree::instance()->init(collection(\app\common\model\Category::select())->toArray())->getChildrenIds($row['id']); + $childrenIds = Tree::instance()->init(collection(\app\common\model\Category::select())->toArray())->getChildrenIds($row['id'], true); if (in_array($params['pid'], $childrenIds)) { - $this->error(__('Can not change the parent to child')); + $this->error(__('Can not change the parent to child or itself')); } } diff --git a/application/admin/lang/zh-cn/category.php b/application/admin/lang/zh-cn/category.php index e7dae0e43..209227459 100644 --- a/application/admin/lang/zh-cn/category.php +++ b/application/admin/lang/zh-cn/category.php @@ -13,6 +13,6 @@ return [ 'Updatetime' => '更新时间', 'Weigh' => '权重', 'Category warmtips' => '温馨提示:栏目类型请前往常规管理->系统配置->字典配置中进行管理', - 'Can not change the parent to child' => '父组别不能是它的子组别', + 'Can not change the parent to child or itself' => '父组别不能是它的子组别或它自己', 'Status' => '状态' ]; -- Gitee