Skip to content

Commit

Permalink
Merge pull request #2157 from moshengrenzenme/master
Browse files Browse the repository at this point in the history
当目录是空的时候默认为根目录
  • Loading branch information
star7th committed Mar 8, 2024
2 parents 5b6b095 + f35cc6c commit 8b13bc8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/Application/Api/Model/CatalogModel.class.php
Expand Up @@ -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); // 去掉第一个字符
Expand Down

0 comments on commit 8b13bc8

Please sign in to comment.