小调整
This commit is contained in:
@@ -20,7 +20,7 @@ class CategoryController extends Controller
|
||||
} else {
|
||||
$articles = $category->relations(Category::TYPE_ARTICLE)->paginate(8);
|
||||
$parent = $category;
|
||||
if ($category->childrens->isEmpty() && $category->patent) {
|
||||
if ($category->childrens->isEmpty() && $category->parent) {
|
||||
$parent = $category->parent;
|
||||
}
|
||||
|
||||
|
||||
@@ -74,4 +74,15 @@ class Category extends Model
|
||||
return $ids;
|
||||
}
|
||||
|
||||
public function getTop()
|
||||
{
|
||||
$parent = $this;
|
||||
|
||||
while ($parent->parent_id) {
|
||||
$parent->parent;
|
||||
}
|
||||
|
||||
return $parent;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
<!-- 分页 -->
|
||||
<div class="pages">
|
||||
@if ($articles->isNotEmpty())
|
||||
{{ $articles->appends(['title'=>request()->title])->links('layouts.pagination') }}
|
||||
{{ $articles->appends(request()->all())->links('layouts.pagination') }}
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -253,7 +253,7 @@
|
||||
<div class="mian-title">
|
||||
<b>{{ getOneCategory(18,'title') }}</b>
|
||||
<span>/ {{ getOneCategory(18,'description') }}</span>
|
||||
<a class="mian-title-more" href="">更多<i class="fa fa-angle-right"></i></a>
|
||||
<a class="mian-title-more" href="{{ getOneCategory(18,'link') }}">更多<i class="fa fa-angle-right"></i></a>
|
||||
</div>
|
||||
<ul class="spiritual-ul">
|
||||
@if (getArticlesBYCate(18,4)->isNotEmpty())
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
<!-- 欢迎语 -->
|
||||
<div class="hello">
|
||||
<div class="container hello-text">
|
||||
今天是 {{ now()->isoFormat('Y年m月d日 a h:mm:ss') }} {{ now()->isoFormat('dddd') }}
|
||||
今天是 {{ now()->isoFormat('Y年M月D日 a h:mm:ss') }} {{ now()->get('dayName') }}
|
||||
</div>
|
||||
</div>
|
||||
<!-- end 欢迎语 -->
|
||||
|
||||
Reference in New Issue
Block a user