浏览代码

后台分类

lizhen_gitee 9 月之前
父节点
当前提交
46aedddcc0
共有 1 个文件被更改,包括 5 次插入4 次删除
  1. 5 4
      application/admin/controller/exam/Cate.php

+ 5 - 4
application/admin/controller/exam/Cate.php

@@ -8,6 +8,7 @@ use fast\Tree;
 use think\Db;
 use think\exception\PDOException;
 use think\exception\ValidateException;
+use think\Exception;
 
 /**
  * 试题分类
@@ -263,14 +264,14 @@ class Cate extends Backend
             // 编辑时
             if ($row) {
                 if ($params['parent_id'] == $row['id']) {
-                    throw new \Exception('不能将当前分类设置为父级分类');
+                    throw new Exception('不能将当前分类设置为父级分类');
                 }
                 if ($parent['kind'] != $params['kind']) {
-                    throw new \Exception('不能将当前分类设置为其他种类的下级');
+                    throw new Exception('不能将当前分类设置为其他种类的下级');
                 }
                 $child_ids = CateModel::where('parent_id', $row['id'])->column('id');
                 if (in_array($params['parent_id'], $child_ids)) {
-                    throw new \Exception('不能将当前分类的子级设置为当前分类的父级');
+                    throw new Exception('不能将当前分类的子级设置为当前分类的父级');
                 }
             }
 
@@ -279,7 +280,7 @@ class Cate extends Backend
             } else if ($parent['level'] == 2) {
                 $params['level'] = 3;
             } else {
-                throw new \Exception('错误:最多添加3级分类,请重新选择父级类别');
+                throw new Exception('最多添加3级分类,请重新选择父级类别');
             }
         }
     }