微调
This commit is contained in:
@@ -11,7 +11,7 @@ class CategoryController extends Controller
|
|||||||
/**
|
/**
|
||||||
* 显示分类
|
* 显示分类
|
||||||
* @param Category $category [description]
|
* @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)
|
public function index(Category $category)
|
||||||
{
|
{
|
||||||
@@ -24,7 +24,8 @@ class CategoryController extends Controller
|
|||||||
}
|
}
|
||||||
$articles = $category->relations(Category::TYPE_ARTICLE)
|
$articles = $category->relations(Category::TYPE_ARTICLE)
|
||||||
->where('status', 1)
|
->where('status', 1)
|
||||||
->latest()
|
->latest('sort')
|
||||||
|
->latest('created_at')
|
||||||
->paginate(8);
|
->paginate(8);
|
||||||
|
|
||||||
$parent = $category;
|
$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>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<ul class="indexExtend-ul studyExtend">
|
<ul class="indexExtend-ul studyExtend">
|
||||||
@if (getArticlesBYCate(30,2)->isNotEmpty())
|
@if (getArticlesBYCate(30,4)->isNotEmpty())
|
||||||
@foreach (getArticlesBYCate(30,2) as $article)
|
@foreach (getArticlesBYCate(30,4) as $article)
|
||||||
<li>
|
<li>
|
||||||
<a href=" {{ $article->link }}">
|
<a href=" {{ $article->link }}">
|
||||||
<div class="ce-nowrap indexExtend-ul-name">
|
<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="survey" style="background-image: url(/assets/index/images/flowBack.png);">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-12 col-md-3 secondLeft">
|
@include('category.left')
|
||||||
<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>
|
|
||||||
<div class="col-xs-12 col-md-9 secondRight">
|
<div class="col-xs-12 col-md-9 secondRight">
|
||||||
<!-- 分院简介 -->
|
<!-- 分院简介 -->
|
||||||
<div class="surveyCont">
|
<div class="surveyCont">
|
||||||
|
|||||||
@@ -6,24 +6,8 @@
|
|||||||
<div class="survey" style="background-image: url(/assets/index/images/flowBack.png);">
|
<div class="survey" style="background-image: url(/assets/index/images/flowBack.png);">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-12 col-md-3 secondLeft">
|
@include('category.left')
|
||||||
<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>
|
|
||||||
<div class="col-xs-12 col-md-9 secondRight">
|
<div class="col-xs-12 col-md-9 secondRight">
|
||||||
<!-- 领导班子 -->
|
<!-- 领导班子 -->
|
||||||
<div class="surveyCont">
|
<div class="surveyCont">
|
||||||
|
|||||||
@@ -8,7 +8,11 @@
|
|||||||
@if ($parent->childrens->isNotEmpty())
|
@if ($parent->childrens->isNotEmpty())
|
||||||
@foreach ($parent->childrens()->orderBy('order','asc')->get() as $child)
|
@foreach ($parent->childrens()->orderBy('order','asc')->get() as $child)
|
||||||
<li @if($category->id==$child->id) class="active" @endif>
|
<li @if($category->id==$child->id) class="active" @endif>
|
||||||
<a href="{{ $child->link }}"><span>{{ $child->title }}</span></a>
|
@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>
|
</li>
|
||||||
@endforeach
|
@endforeach
|
||||||
@endif
|
@endif
|
||||||
@@ -18,3 +22,4 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
|
|||||||
@@ -6,24 +6,7 @@
|
|||||||
<div class="survey" style="background-image: url(/assets/index/images/flowBack.png);">
|
<div class="survey" style="background-image: url(/assets/index/images/flowBack.png);">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-12 col-md-3 secondLeft">
|
@include('category.left')
|
||||||
<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>
|
|
||||||
<div class="col-xs-12 col-md-9 secondRight">
|
<div class="col-xs-12 col-md-9 secondRight">
|
||||||
<!-- 内设机构 -->
|
<!-- 内设机构 -->
|
||||||
<div class="surveyCont">
|
<div class="surveyCont">
|
||||||
@@ -33,22 +16,22 @@
|
|||||||
{{ getOneCategory(13,'title') }}
|
{{ getOneCategory(13,'title') }}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<a href="{{ getOneCategory(13,'link') }}" class="secondTop-more">
|
{{-- <a href="{{ getOneCategory(13,'link') }}" class="secondTop-more">--}}
|
||||||
查看更多>>
|
{{-- 查看更多>>--}}
|
||||||
</a>
|
{{-- </a>--}}
|
||||||
</div>
|
</div>
|
||||||
<div class="organCont">
|
<div class="organCont">
|
||||||
@if (getCateChild(13)->isNotEmpty())
|
@if (getCateChild(13)->isNotEmpty())
|
||||||
@foreach (getCateChild(13) as $cate)
|
@foreach (getCateChild(13) as $cate)
|
||||||
<div class="organLabel">
|
<div class="organLabel">
|
||||||
<!-- <div class="organLabel-name">
|
<!-- <div class="organLabel-name">
|
||||||
{{ $cate->title }}
|
{{ $cate->title }}
|
||||||
</div> -->
|
</div> -->
|
||||||
<ul class="organLabel-list">
|
<ul class="organLabel-list">
|
||||||
@if($cate->childrens)
|
@if($cate->childrens)
|
||||||
@foreach ($cate->childrens as $child)
|
@foreach ($cate->childrens as $child)
|
||||||
<li>
|
<li>
|
||||||
<a href="{{ $child->link }}">{{ $child->title }}</a>
|
<a>{{ $child->title }}</a>
|
||||||
</li>
|
</li>
|
||||||
@endforeach
|
@endforeach
|
||||||
@endif
|
@endif
|
||||||
|
|||||||
@@ -88,7 +88,7 @@
|
|||||||
<span class="IndexExpertNew-tips">客座教授</span>
|
<span class="IndexExpertNew-tips">客座教授</span>
|
||||||
<div class="IndexExpertNew-title">{{ $article->title }}</div>
|
<div class="IndexExpertNew-title">{{ $article->title }}</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- <div class="ce-img IndexExpert-img">
|
<!-- <div class="ce-img IndexExpert-img">
|
||||||
<span style="background-image: url({{ $article->cover_path }});"></span>
|
<span style="background-image: url({{ $article->cover_path }});"></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="IndexExpert-name">
|
<div class="IndexExpert-name">
|
||||||
|
|||||||
@@ -18,12 +18,12 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<ul class="newBranch">
|
<ul class="newBranch">
|
||||||
@if (getArticlesBYCate(7,2)->isNotEmpty())
|
@if (getArticlesBYCate(7,4)->isNotEmpty())
|
||||||
@foreach (getArticlesBYCate(7,2) as $article)
|
@foreach (getArticlesBYCate(7,4) as $article)
|
||||||
<li>
|
<li>
|
||||||
<a href="{{ $article->link }}">
|
<a href="{{ $article->link }}">
|
||||||
<div class="ce-img newBranch-img">
|
<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>
|
||||||
<div class="newBranch-cont" style="padding-left: 0">
|
<div class="newBranch-cont" style="padding-left: 0">
|
||||||
<div class="newBranch-time">
|
<div class="newBranch-time">
|
||||||
@@ -49,6 +49,46 @@
|
|||||||
</div>
|
</div>
|
||||||
</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="surveyCont">
|
||||||
<div class="secondTop">
|
<div class="secondTop">
|
||||||
|
|||||||
Reference in New Issue
Block a user