更新
This commit is contained in:
@@ -39,7 +39,7 @@ class IndexController extends AdminController
|
||||
return $this->categories()->pluck('title');
|
||||
})->label();
|
||||
$grid->column('title', '文章标题');
|
||||
$grid->column('sort', '序号');
|
||||
$grid->column('sort', '序号')->editable();
|
||||
$states = [
|
||||
'on' => ['value' => 1, 'text' => '打开', 'color' => 'primary'],
|
||||
'off' => ['value' => 2, 'text' => '关闭', 'color' => 'default'],
|
||||
@@ -62,7 +62,7 @@ class IndexController extends AdminController
|
||||
$form->belongsToMany('categories', CategorySelectAble::class, __('关联分类'))->required();
|
||||
|
||||
$form->textarea('description', '内容简介');
|
||||
|
||||
|
||||
$form->text('duty', '职务')->help('领导班子需要添加此数据');
|
||||
$form->text('rank', '职称')->help('领导班子需要添加此数据');
|
||||
|
||||
|
||||
@@ -53,7 +53,8 @@ function getOneArticleBYCate($categoryId, $result = '')
|
||||
->whereHas('categories', function ($q) use ($categoryId) {
|
||||
$q->where('id', $categoryId);
|
||||
})
|
||||
->latest()
|
||||
->latest('sort')
|
||||
->latest('created_at')
|
||||
->first();
|
||||
|
||||
if ($info) {
|
||||
@@ -87,7 +88,8 @@ function getArticlesBYCate($categoryId, $take = 8, $mark = 'one', $hasCover = fa
|
||||
->whereHas('categories', function ($q) use ($categoryId) {
|
||||
$q->where('id', $categoryId);
|
||||
})
|
||||
->orderBy('sort', $order)
|
||||
->latest('sort')
|
||||
->latest('created_at')
|
||||
->when($hasCover, function ($q) {
|
||||
$q->whereNotNull('cover');
|
||||
})
|
||||
@@ -104,7 +106,8 @@ function getArticlesBYCate($categoryId, $take = 8, $mark = 'one', $hasCover = fa
|
||||
->when($hasCover, function ($q) {
|
||||
$q->whereNotNull('cover');
|
||||
})
|
||||
->orderBy('sort', $order)
|
||||
->latest('sort')
|
||||
->latest('created_at')
|
||||
->take($take)
|
||||
->get();
|
||||
}
|
||||
@@ -179,7 +182,8 @@ function getArticlesByCateIds($take = 8, $hasCover = false)
|
||||
->whereHas('categories', function ($q) use ($ids) {
|
||||
$q->whereIn('id', $ids);
|
||||
})
|
||||
->latest()
|
||||
->latest('sort')
|
||||
->latest('created_at')
|
||||
->when($hasCover, function ($q) {
|
||||
$q->whereNotNull('cover')->orWhere('cover', '<>', '');
|
||||
})
|
||||
@@ -200,7 +204,8 @@ function getArticlesByCateIds($take = 8, $hasCover = false)
|
||||
function getArticlesByPosition($postion)
|
||||
{
|
||||
$articles = Article::ofPosition($postion)
|
||||
->latest()
|
||||
->latest('sort')
|
||||
->latest('created_at')
|
||||
->take(5)
|
||||
->get();
|
||||
|
||||
|
||||
@@ -210,6 +210,12 @@ img {max-width: 100%;}
|
||||
.indexPrize-img {position: relative; width: 100%; padding-top: 70%; margin-bottom: 10px; display: block;}
|
||||
.indexPrize-title {font-size: 18px;}
|
||||
.indexPrize-pagination {bottom: -5px !important;}
|
||||
.IndexExpertNew {overflow: hidden; margin: 0 20px;}
|
||||
.IndexExpertNew li { width: calc(33.33% - 40px); float: left; margin: 20px; padding: 15px 0; text-align: center; box-sizing: border-box;border: 1px solid #f5f5f5;border-radius: 5px;background: #f5f5f5;}
|
||||
.IndexExpertNew-title {font-size: 18px; font-weight: 600}
|
||||
.IndexExpertNew-tips {margin-bottom: 20px; color: #999; display: block; position: relative;}
|
||||
.IndexExpertNew-tips::after {position: absolute; content: ''; left: calc(50% - 16px); bottom: -10px; background-color: #ffb993; width: 30px; height: 4px;
|
||||
border-radius: 22px;}
|
||||
|
||||
|
||||
/* 友情链接 */
|
||||
|
||||
@@ -16,16 +16,19 @@
|
||||
{{ getOneCategory(12,'title') }}
|
||||
</div>
|
||||
</div>
|
||||
<ul class="indexExtend-ul studyExtend">
|
||||
<ul class="mediaList">
|
||||
@if (getArticlesBYCate(12,2)->isNotEmpty())
|
||||
@foreach (getArticlesBYCate(12,2) as $article)
|
||||
<li>
|
||||
<a href=" {{ $article->link }}">
|
||||
<div class="ce-nowrap indexExtend-ul-name">
|
||||
{{ $article->title }}
|
||||
<a href="{{ $article->link }}">
|
||||
<div class="ce-img mediaList-img">
|
||||
<span style="background-image: url({{ $article->cover_path }});"></span>
|
||||
</div>
|
||||
<div class="ce-nowrap-multi indexExtend-ul-text">
|
||||
{{ $article->description }}
|
||||
<div class="mediaList-text">
|
||||
<div class="ce-nowrap-multi mediaList-name">
|
||||
{{ $article->title }}
|
||||
</div>
|
||||
<span>{{ $article->description }}</span>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
@@ -67,37 +70,7 @@
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<!-- 媒体报道 -->
|
||||
<div class="surveyCont">
|
||||
<div class="secondTop">
|
||||
<div class="secondTop-name">
|
||||
<img src="/assets/index/images/surveyIcon_02.png">
|
||||
{{ getOneCategory(11,'title') }}
|
||||
</div>
|
||||
<a href="{{ getOneCategory(11,'link') }}" class="secondTop-more">
|
||||
查看更多>>
|
||||
</a>
|
||||
</div>
|
||||
<ul class="mediaList">
|
||||
@if (getArticlesBYCate(30,2)->isNotEmpty())
|
||||
@foreach (getArticlesBYCate(30,2) as $article)
|
||||
<li>
|
||||
<a href="{{ $article->link }}">
|
||||
<div class="ce-img mediaList-img">
|
||||
<span style="background-image: url({{ $article->cover_path }});"></span>
|
||||
</div>
|
||||
<div class="mediaList-text">
|
||||
<div class="ce-nowrap-multi mediaList-name">
|
||||
{{ $article->title }}
|
||||
</div>
|
||||
<span>{{ $article->description }}</span>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
@endforeach
|
||||
@endif
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -3,51 +3,52 @@
|
||||
@section('title', '首页')
|
||||
|
||||
@section('content')
|
||||
<!-- 科学研究 -->
|
||||
<div class="survey" style="background-image: url(/assets/index/images/studyBack.png);">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
@include('category.left')
|
||||
<div class="col-xs-12 col-md-9 secondRight">
|
||||
<!-- 科研动态 -->
|
||||
<div class="surveyCont">
|
||||
<div class="secondTop">
|
||||
<div class="secondTop-name">
|
||||
<img src="/assets/index/images/studyIcon_00.png"/>
|
||||
{{ $category->title }}
|
||||
<!-- 科学研究 -->
|
||||
<div class="survey" style="background-image: url(/assets/index/images/studyBack.png);">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
@include('category.left')
|
||||
<div class="col-xs-12 col-md-9 secondRight">
|
||||
<!-- 科研动态 -->
|
||||
<div class="surveyCont">
|
||||
<div class="secondTop">
|
||||
<div class="secondTop-name">
|
||||
<img src="/assets/index/images/studyIcon_00.png"/>
|
||||
{{ $category->title }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="dateExtend">
|
||||
<ul class="dateExtend">
|
||||
@if ($articles->isNotEmpty())
|
||||
@foreach ($articles as $article)
|
||||
<li>
|
||||
<a href="{{ $article->link }}">
|
||||
<div class="dateExtend-left">
|
||||
<span>{{ $article->created_at->format('m/d') }}</span>
|
||||
{{ $article->created_at->format('Y') }}
|
||||
|
||||
</div>
|
||||
<div class="dateExtend-right">
|
||||
<div class="ce-nowrap indexExtend-ul-name">
|
||||
{{ $article->title }}
|
||||
</div>
|
||||
<div class="ce-nowrap indexExtend-ul-text">
|
||||
{{ $article->description }}
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
@endforeach
|
||||
@endif
|
||||
</ul>
|
||||
|
||||
<!-- 分页 -->
|
||||
|
||||
@if ($articles->isNotEmpty())
|
||||
@foreach ($articles as $article)
|
||||
<li>
|
||||
<a href="">
|
||||
<div class="dateExtend-left">
|
||||
<span>06/01</span>
|
||||
2021
|
||||
</div>
|
||||
<div class="dateExtend-right">
|
||||
<div class="ce-nowrap indexExtend-ul-name">
|
||||
{{ $article->title }}
|
||||
</div>
|
||||
<div class="ce-nowrap indexExtend-ul-text">
|
||||
{{ $article->description }}
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
@endforeach
|
||||
{{ $articles->links('layouts.pagination') }}
|
||||
@endif
|
||||
</ul>
|
||||
|
||||
<!-- 分页 -->
|
||||
|
||||
@if ($articles->isNotEmpty())
|
||||
{{ $articles->links('layouts.pagination') }}
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@@ -388,19 +388,23 @@
|
||||
|
||||
<!-- 专家智库 -->
|
||||
<div role="screen-2" class="tab-pane fade" id="screen-2">
|
||||
<ul class="IndexExpert-ul">
|
||||
@if (getArticlesBYCate(29,3)->isNotEmpty())
|
||||
@foreach (getArticlesBYCate(29,3) as $article)
|
||||
<ul class="IndexExpertNew">
|
||||
@if (getArticlesBYCate(29,9)->isNotEmpty())
|
||||
@foreach (getArticlesBYCate(29,9) as $article)
|
||||
<li>
|
||||
<a href="{{ $article->link }}" title="{{ $article->title }}">
|
||||
<div class="ce-img IndexExpert-img">
|
||||
<div class="IndexExpertNew-li">
|
||||
<span class="IndexExpertNew-tips">客座教授</span>
|
||||
<div class="IndexExpertNew-title">{{ $article->title }}</div>
|
||||
</div>
|
||||
<!-- <div class="ce-img IndexExpert-img">
|
||||
<span style="background-image: url({{ $article->cover_path }});"></span>
|
||||
</div>
|
||||
<div class="IndexExpert-name">
|
||||
<div class="IndexExpert-title">
|
||||
<span>{{ $article->title }}</span>科学专家
|
||||
<span>{{ $article->title }}</span>客座教授
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
</a>
|
||||
</li>
|
||||
@endforeach
|
||||
|
||||
Reference in New Issue
Block a user