微调
This commit is contained in:
@@ -11,7 +11,7 @@ class CategoryController extends Controller
|
||||
/**
|
||||
* 显示分类
|
||||
* @param Category $category [description]
|
||||
* @return [type] [description]
|
||||
* @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector|\Illuminate\View\View [type] [description]
|
||||
*/
|
||||
public function index(Category $category)
|
||||
{
|
||||
@@ -24,7 +24,8 @@ class CategoryController extends Controller
|
||||
}
|
||||
$articles = $category->relations(Category::TYPE_ARTICLE)
|
||||
->where('status', 1)
|
||||
->latest()
|
||||
->latest('sort')
|
||||
->latest('created_at')
|
||||
->paginate(8);
|
||||
|
||||
$parent = $category;
|
||||
|
||||
5
config/setting.php
Normal file
5
config/setting.php
Normal file
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'no_href' => [13],
|
||||
];
|
||||
@@ -53,8 +53,8 @@
|
||||
</a>
|
||||
</div>
|
||||
<ul class="indexExtend-ul studyExtend">
|
||||
@if (getArticlesBYCate(30,2)->isNotEmpty())
|
||||
@foreach (getArticlesBYCate(30,2) as $article)
|
||||
@if (getArticlesBYCate(30,4)->isNotEmpty())
|
||||
@foreach (getArticlesBYCate(30,4) as $article)
|
||||
<li>
|
||||
<a href=" {{ $article->link }}">
|
||||
<div class="ce-nowrap indexExtend-ul-name">
|
||||
|
||||
@@ -6,24 +6,8 @@
|
||||
<div class="survey" style="background-image: url(/assets/index/images/flowBack.png);">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-3 secondLeft">
|
||||
<div class="secondLeft-title">
|
||||
<span>{{ $parent->title }}</span>
|
||||
<img src="/assets/index/images/secondLeft_logo.png"/>
|
||||
</div>
|
||||
<ul class="secondLeft-list">
|
||||
@if ($parent->childrens->isNotEmpty())
|
||||
@foreach ($parent->childrens()->orderBy('order','asc')->get() as $child)
|
||||
<li @if($category->id==$child->id) class="active" @endif>
|
||||
<a href="{{ route('category.show',$child) }}"><span>{{ $child->title }}</span></a>
|
||||
</li>
|
||||
@endforeach
|
||||
@endif
|
||||
</ul>
|
||||
<div class="secondLeft-img">
|
||||
<img src="/assets/index/images/secondLeft_back.png"/>
|
||||
</div>
|
||||
</div>
|
||||
@include('category.left')
|
||||
|
||||
<div class="col-xs-12 col-md-9 secondRight">
|
||||
<!-- 分院简介 -->
|
||||
<div class="surveyCont">
|
||||
|
||||
@@ -6,24 +6,8 @@
|
||||
<div class="survey" style="background-image: url(/assets/index/images/flowBack.png);">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-3 secondLeft">
|
||||
<div class="secondLeft-title">
|
||||
<span>{{ $parent->title }}</span>
|
||||
<img src="/assets/index/images/secondLeft_logo.png"/>
|
||||
</div>
|
||||
<ul class="secondLeft-list">
|
||||
@if ($parent->childrens->isNotEmpty())
|
||||
@foreach ($parent->childrens()->orderBy('order','asc')->get() as $child)
|
||||
<li @if($category->id==$child->id) class="active" @endif>
|
||||
<a href="{{ route('category.show',$child) }}"><span>{{ $child->title }}</span></a>
|
||||
</li>
|
||||
@endforeach
|
||||
@endif
|
||||
</ul>
|
||||
<div class="secondLeft-img">
|
||||
<img src="/assets/index/images/secondLeft_back.png"/>
|
||||
</div>
|
||||
</div>
|
||||
@include('category.left')
|
||||
|
||||
<div class="col-xs-12 col-md-9 secondRight">
|
||||
<!-- 领导班子 -->
|
||||
<div class="surveyCont">
|
||||
|
||||
@@ -8,7 +8,11 @@
|
||||
@if ($parent->childrens->isNotEmpty())
|
||||
@foreach ($parent->childrens()->orderBy('order','asc')->get() as $child)
|
||||
<li @if($category->id==$child->id) class="active" @endif>
|
||||
@if(in_array($parent->id,config('setting.no_href')))
|
||||
<a><span>{{ $child->title }}</span></a>
|
||||
@else
|
||||
<a href="{{ $child->link }}"><span>{{ $child->title }}</span></a>
|
||||
@endif
|
||||
</li>
|
||||
@endforeach
|
||||
@endif
|
||||
@@ -18,3 +22,4 @@
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
|
||||
@@ -6,24 +6,7 @@
|
||||
<div class="survey" style="background-image: url(/assets/index/images/flowBack.png);">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-3 secondLeft">
|
||||
<div class="secondLeft-title">
|
||||
<span>{{ $parent->title }}</span>
|
||||
<img src="/assets/index/images/secondLeft_logo.png"/>
|
||||
</div>
|
||||
<ul class="secondLeft-list">
|
||||
@if ($parent->childrens->isNotEmpty())
|
||||
@foreach ($parent->childrens()->orderBy('order','asc')->get() as $child)
|
||||
<li @if($category->id==$child->id) class="active" @endif>
|
||||
<a href="{{ route('category.show',$child) }}"><span>{{ $child->title }}</span></a>
|
||||
</li>
|
||||
@endforeach
|
||||
@endif
|
||||
</ul>
|
||||
<div class="secondLeft-img">
|
||||
<img src="/assets/index/images/secondLeft_back.png"/>
|
||||
</div>
|
||||
</div>
|
||||
@include('category.left')
|
||||
<div class="col-xs-12 col-md-9 secondRight">
|
||||
<!-- 内设机构 -->
|
||||
<div class="surveyCont">
|
||||
@@ -33,9 +16,9 @@
|
||||
{{ getOneCategory(13,'title') }}
|
||||
|
||||
</div>
|
||||
<a href="{{ getOneCategory(13,'link') }}" class="secondTop-more">
|
||||
查看更多>>
|
||||
</a>
|
||||
{{-- <a href="{{ getOneCategory(13,'link') }}" class="secondTop-more">--}}
|
||||
{{-- 查看更多>>--}}
|
||||
{{-- </a>--}}
|
||||
</div>
|
||||
<div class="organCont">
|
||||
@if (getCateChild(13)->isNotEmpty())
|
||||
@@ -48,7 +31,7 @@
|
||||
@if($cate->childrens)
|
||||
@foreach ($cate->childrens as $child)
|
||||
<li>
|
||||
<a href="{{ $child->link }}">{{ $child->title }}</a>
|
||||
<a>{{ $child->title }}</a>
|
||||
</li>
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
@@ -18,12 +18,12 @@
|
||||
</div>
|
||||
</div>
|
||||
<ul class="newBranch">
|
||||
@if (getArticlesBYCate(7,2)->isNotEmpty())
|
||||
@foreach (getArticlesBYCate(7,2) as $article)
|
||||
@if (getArticlesBYCate(7,4)->isNotEmpty())
|
||||
@foreach (getArticlesBYCate(7,4) as $article)
|
||||
<li>
|
||||
<a href="{{ $article->link }}">
|
||||
<div class="ce-img newBranch-img">
|
||||
<span style="background-image: url({{ $article->cover_path }});"></span>
|
||||
{{-- <span style="background-image: url({{ $article->cover_path }});"></span>--}}
|
||||
</div>
|
||||
<div class="newBranch-cont" style="padding-left: 0">
|
||||
<div class="newBranch-time">
|
||||
@@ -49,6 +49,46 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 媒体报道 -->
|
||||
<div class="surveyCont">
|
||||
<div class="secondTop">
|
||||
<div class="secondTop-name">
|
||||
<img src="/assets/index/images/newsIcon_00.png"/>
|
||||
{{ getOneCategory(17,'title') }}
|
||||
</div>
|
||||
</div>
|
||||
<ul class="newBranch">
|
||||
@if (getArticlesBYCate(17,4)->isNotEmpty())
|
||||
@foreach (getArticlesBYCate(17,4) as $article)
|
||||
<li>
|
||||
<a href="{{ $article->link }}">
|
||||
<div class="ce-img newBranch-img">
|
||||
{{-- <span style="background-image: url({{ $article->cover_path }});"></span>--}}
|
||||
</div>
|
||||
<div class="newBranch-cont" style="padding-left: 0">
|
||||
<div class="newBranch-time">
|
||||
<span>{{ $article->created_at->format('d') }}</span>
|
||||
{{ $article->created_at->format('Y/m') }}
|
||||
</div>
|
||||
<div class="newBranch-text">
|
||||
<div class="ce-nowrap newBranch-name">
|
||||
{{ $article->title }}
|
||||
</div>
|
||||
<div class="ce-nowrap-multi newBranch-tips">
|
||||
{{ $article->description }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
@endforeach
|
||||
@endif
|
||||
</ul>
|
||||
<div class="secondMore">
|
||||
<a href="{{ getOneCategory(17,'link') }}">查看更多></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 获得奖项 -->
|
||||
<div class="surveyCont">
|
||||
<div class="secondTop">
|
||||
|
||||
Reference in New Issue
Block a user