更新:修复后台内容管理导航面包屑显示错误的bug
parent
2b6ad4fe1f
commit
37f09c42de
|
@ -123,22 +123,23 @@ class Category extends Base
|
||||||
$category->save();
|
$category->save();
|
||||||
}
|
}
|
||||||
|
|
||||||
//递归获取上级栏目名称
|
//递归获取栏目名称面包屑
|
||||||
public static function getCatesCrumbs($currentId = 0)
|
public static function getCatesCrumbs($currentId = 0)
|
||||||
{
|
{
|
||||||
$crumbs = [];
|
$crumbs = [];
|
||||||
$category = self::getById($currentId);
|
$category = self::getById($currentId);
|
||||||
if($category['parent_id'] == 0){
|
if($category) {
|
||||||
$cateCrumbs[] = $category['title'];
|
if($category['parent_id'] != 0){
|
||||||
}else{
|
$categoryIds = explode(',', trim($category['path'], ','));
|
||||||
$categoryIds = explode(',', trim($category['path'], ','));
|
$categories = self::where('id', 'in', $categoryIds)->column('*', 'id');
|
||||||
$categories = self::where('id', 'in', $categoryIds)->column('*', 'id');
|
foreach($categoryIds as $id){
|
||||||
foreach($categoryIds as $id){
|
if(isset($categories[$id])){
|
||||||
if(isset($categories[$id])){
|
$crumbs[] = $categories[$id]['title'];
|
||||||
$crumbs[] = $categories[$id]['title'];
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
$crumbs[] = $category['title'];
|
||||||
|
}
|
||||||
return $crumbs;
|
return $crumbs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 248 KiB |
|
@ -137,7 +137,7 @@
|
||||||
'" controls="controls" width="260">您的浏览器不支持 video 标签。</video>' +
|
'" controls="controls" width="260">您的浏览器不支持 video 标签。</video>' +
|
||||||
'</div><hr />';
|
'</div><hr />';
|
||||||
$('#'+$(obj).attr('data-box')).html(imTpl);
|
$('#'+$(obj).attr('data-box')).html(imTpl);
|
||||||
$('#'+$(obj).attr('data-input')).val($(obj).attr('src'));
|
$('#'+$(obj).attr('data-input')).val($(obj).attr('data-src'));
|
||||||
parent.layer.close($(obj).attr('data-id'));
|
parent.layer.close($(obj).attr('data-id'));
|
||||||
$(window).trigger("resize");
|
$(window).trigger("resize");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue