From f35cc6cd2f00e988a32ff035ea6b4caca63c7711 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=8C=E7=94=9F=E4=BA=BA?= Date: Fri, 8 Mar 2024 14:23:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BD=93=E7=9B=AE=E5=BD=95=E6=98=AF=E7=A9=BA?= =?UTF-8?q?=E7=9A=84=E6=97=B6=E5=80=99=E9=BB=98=E8=AE=A4=E4=B8=BA=E6=A0=B9?= =?UTF-8?q?=E7=9B=AE=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/Application/Api/Model/CatalogModel.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/Application/Api/Model/CatalogModel.class.php b/server/Application/Api/Model/CatalogModel.class.php index bce3c4def..b175321d2 100644 --- a/server/Application/Api/Model/CatalogModel.class.php +++ b/server/Application/Api/Model/CatalogModel.class.php @@ -269,7 +269,7 @@ private function _insertCat($item_id, $catalogs, $userInfo, $parent_cat_id = 0, // 用路径的形式(比如'二级目录/三级目录/四级目录')来保存目录信息并返回最后一层目录的id public function saveCatPath($catPath, $item_id) { - if (!$catPath) return false; + if (!$catPath) return 0; // $catPath是以斜杠 / 开头,且$catPath长度大于1(即不只是 / ), 则把第一个 / 去掉 if (substr($catPath, 0, 1) == '/' && strlen($catPath) > 1) { $catPath = substr($catPath, 1); // 去掉第一个字符