调整但行
This commit is contained in:
@@ -26,7 +26,7 @@ class IndexController extends AdminController
|
|||||||
}, '所有分类'));
|
}, '所有分类'));
|
||||||
});
|
});
|
||||||
$filter->column(1 / 2, function ($filter) {
|
$filter->column(1 / 2, function ($filter) {
|
||||||
$filter->equal('position', '定位')
|
$filter->equal('position', '首页推荐位')
|
||||||
->select(Article::POSITIONS);
|
->select(Article::POSITIONS);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -76,7 +76,7 @@ class IndexController extends AdminController
|
|||||||
$form->number('sort', '序号')->default(0)->rules('required', ['required' => '序号必须填写'])->help('倒序优先');
|
$form->number('sort', '序号')->default(0)->rules('required', ['required' => '序号必须填写'])->help('倒序优先');
|
||||||
$form->switch('status', '状态')->default(1);
|
$form->switch('status', '状态')->default(1);
|
||||||
$form->text('url', '外链地址');
|
$form->text('url', '外链地址');
|
||||||
$form->select('position', '定位')
|
$form->select('position', '首页推荐位')
|
||||||
->options(Article::POSITIONS);
|
->options(Article::POSITIONS);
|
||||||
$form->datetime('created_at', '发布时间');
|
$form->datetime('created_at', '发布时间');
|
||||||
$form->saved(function ($form) {
|
$form->saved(function ($form) {
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ class IndexController extends AdminController
|
|||||||
->removable()
|
->removable()
|
||||||
->uniqueName();
|
->uniqueName();
|
||||||
$form->number('order', '排序')->default(0);
|
$form->number('order', '排序')->default(0);
|
||||||
$form->switch('top_show', '顶部导航显示')->states()->default(0);
|
// $form->switch('top_show', '顶部导航显示')->states()->default(0);
|
||||||
$form->switch('status', '显示')->states()->default(1);
|
$form->switch('status', '显示')->states()->default(1);
|
||||||
$form->text('url', '跳转地址')->help('设置后直接跳转到设置的url');
|
$form->text('url', '跳转地址')->help('设置后直接跳转到设置的url');
|
||||||
|
|
||||||
@@ -122,7 +122,7 @@ class IndexController extends AdminController
|
|||||||
$form->number('order', '排序')->default(0)->help('正序优先');
|
$form->number('order', '排序')->default(0)->help('正序优先');
|
||||||
|
|
||||||
$form->switch('status', '显示')->states()->default(1);
|
$form->switch('status', '显示')->states()->default(1);
|
||||||
$form->switch('top_show', '顶部导航显示')->states();
|
// $form->switch('top_show', '顶部导航显示')->states();
|
||||||
$form->text('url', '跳转地址')->help('设置后直接跳转到设置的url');
|
$form->text('url', '跳转地址')->help('设置后直接跳转到设置的url');
|
||||||
|
|
||||||
$form->saving(function (Form $form) {
|
$form->saving(function (Form $form) {
|
||||||
|
|||||||
@@ -182,10 +182,12 @@ function getArtilesByCates($cate_id, $take = 8)
|
|||||||
$cate_ids = Category::where('parent_id', $cate_id)
|
$cate_ids = Category::where('parent_id', $cate_id)
|
||||||
->orWhere('id', $cate_id)
|
->orWhere('id', $cate_id)
|
||||||
->whereIn('type', [Category::TYPE_ARTICLE, Category::TYPE_SHOW])
|
->whereIn('type', [Category::TYPE_ARTICLE, Category::TYPE_SHOW])
|
||||||
->get();
|
->pluck('id')
|
||||||
|
->toArray();
|
||||||
|
|
||||||
return Article::whereIn('category_id', $cate_ids)
|
return Article::whereIn('category_id', $cate_ids)
|
||||||
->latest()
|
->latest()
|
||||||
|
->take($take)
|
||||||
->get();
|
->get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,6 @@
|
|||||||
<!-- 科研领域 -->
|
<!-- 科研领域 -->
|
||||||
<div class="sub-title">
|
<div class="sub-title">
|
||||||
<b><i class="fa fa-flag"></i>{{ getOneCategory(14,'title') }}</b>
|
<b><i class="fa fa-flag"></i>{{ getOneCategory(14,'title') }}</b>
|
||||||
<a href="{{ getOneCategory(14,'link') }}">更多</a>
|
|
||||||
</div>
|
</div>
|
||||||
<ul class="research-award-ul">
|
<ul class="research-award-ul">
|
||||||
@foreach (getArticlesBYCate(14,6) as $article)
|
@foreach (getArticlesBYCate(14,6) as $article)
|
||||||
|
|||||||
@@ -1,15 +1,46 @@
|
|||||||
<!-- <img class="mian-nav-cover" src="{{ $parent->cover_path }}" alt="导航封面"> -->
|
<!-- <img class="mian-nav-cover" src="{{ $parent->cover_path }}" alt="导航封面"> -->
|
||||||
|
@if (getCateChild($category->id)->isNotEmpty())
|
||||||
<div class="mian-nav-title">
|
<div class="mian-nav-title">
|
||||||
|
|
||||||
{{ $category->title }}
|
{{ $category->title }}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<ul class="mian-nav-ul">
|
<ul class="mian-nav-ul">
|
||||||
@if (getCateChild($category->id)->isNotEmpty())
|
|
||||||
@foreach (getCateChild($category->id) as $children)
|
@foreach (getCateChild($category->id) as $children)
|
||||||
<li class="show">
|
<li class="show">
|
||||||
<a href="{{ $children->link }}">{{ $children->title }}</a>
|
<a href="{{ $children->link }}">{{ $children->title }}</a>
|
||||||
</li>
|
</li>
|
||||||
@endforeach
|
@endforeach
|
||||||
@endif
|
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
@else
|
||||||
|
<div class="mian-nav-title">
|
||||||
|
{{ $category->parent->title }}
|
||||||
|
</div>
|
||||||
|
<ul class="mian-nav-ul">
|
||||||
|
@foreach (getCateChild($category->parent->id) as $children)
|
||||||
|
<li class="show">
|
||||||
|
<a href="{{ $children->link }}">{{ $children->title }}</a>
|
||||||
|
</li>
|
||||||
|
@endforeach
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
@endif
|
||||||
|
|
||||||
|
{{--<div class="mian-nav-title">--}}
|
||||||
|
{{-- {{ $category->title }}--}}
|
||||||
|
{{--</div>--}}
|
||||||
|
{{--<ul class="mian-nav-ul">--}}
|
||||||
|
{{-- @if (getCateChild($category->id)->isNotEmpty())--}}
|
||||||
|
{{-- @foreach (getCateChild($category->id) as $children)--}}
|
||||||
|
{{-- <li class="show">--}}
|
||||||
|
{{-- <a href="{{ $children->link }}">{{ $children->title }}</a>--}}
|
||||||
|
{{-- </li>--}}
|
||||||
|
{{-- @endforeach--}}
|
||||||
|
{{-- @else--}}
|
||||||
|
{{-- @foreach (getCateChild($category->parent->id) as $children)--}}
|
||||||
|
{{-- <li class="show">--}}
|
||||||
|
{{-- <a href="{{ $children->link }}">{{ $children->title }}</a>--}}
|
||||||
|
{{-- </li>--}}
|
||||||
|
{{-- @endforeach--}}
|
||||||
|
{{-- @endif--}}
|
||||||
|
{{--</ul>--}}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<div class="container mian">
|
<div class="container mian">
|
||||||
<!-- content-nav -->
|
<!-- content-nav -->
|
||||||
<nav class="mian-nav">
|
<nav class="mian-nav">
|
||||||
@include('layouts.left',$parent)
|
@include('category.left',$parent)
|
||||||
</nav>
|
</nav>
|
||||||
<!-- content-content -->
|
<!-- content-content -->
|
||||||
<div class="mian-content">
|
<div class="mian-content">
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<div class="container mian">
|
<div class="container mian">
|
||||||
<!-- content-nav -->
|
<!-- content-nav -->
|
||||||
<nav class="mian-nav">
|
<nav class="mian-nav">
|
||||||
@include('layouts.left',$parent)
|
@include('category.left',$parent)
|
||||||
</nav>
|
</nav>
|
||||||
<!-- content-content -->
|
<!-- content-content -->
|
||||||
<div class="mian-content">
|
<div class="mian-content">
|
||||||
|
|||||||
@@ -78,7 +78,9 @@
|
|||||||
|
|
||||||
<a href="{{ $pos_b->link }}" class="index-mian-news-href">
|
<a href="{{ $pos_b->link }}" class="index-mian-news-href">
|
||||||
<p class="nowrap-multi">{{ $pos_b->title }}</p>
|
<p class="nowrap-multi">{{ $pos_b->title }}</p>
|
||||||
<p class="nowrap">{{ $pos_b->created_at->format('Y-m-d') }}</p>
|
<p class="nowrap">
|
||||||
|
{{-- {{ $pos_b->created_at->format('Y-m-d') }}--}}
|
||||||
|
</p>
|
||||||
</a>
|
</a>
|
||||||
@endif
|
@endif
|
||||||
</div>
|
</div>
|
||||||
@@ -89,7 +91,7 @@
|
|||||||
<a href="{{ $info->link }}" class="nowrap">
|
<a href="{{ $info->link }}" class="nowrap">
|
||||||
<i class="fa fa-chevron-circle-right"></i>
|
<i class="fa fa-chevron-circle-right"></i>
|
||||||
{{ $info->title }}
|
{{ $info->title }}
|
||||||
<span>{{ $info->created_at->format('Y-m-d') }}</span>
|
{{-- <span>{{ $info->created_at->format('Y-m-d') }}</span>--}}
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
@endforeach
|
@endforeach
|
||||||
@@ -99,7 +101,7 @@
|
|||||||
|
|
||||||
<!-- 科技成果 -->
|
<!-- 科技成果 -->
|
||||||
<div class="index-mian-title">
|
<div class="index-mian-title">
|
||||||
<span><i class="fa fa-flask"></i>{{ getOneCategory(10,'title') }}</span>
|
<span><i class="fa fa-flask"></i>{{ getOneCategory(19,'title') }}</span>
|
||||||
<a href="{{ getOneCategory(19,'link') }}">更多<i class="fa fa-plus"></i></a>
|
<a href="{{ getOneCategory(19,'link') }}">更多<i class="fa fa-plus"></i></a>
|
||||||
</div>
|
</div>
|
||||||
<div class="index-mian-news">
|
<div class="index-mian-news">
|
||||||
@@ -111,7 +113,10 @@
|
|||||||
|
|
||||||
<a href="{{ $pos_c->link }}" class="index-mian-news-href">
|
<a href="{{ $pos_c->link }}" class="index-mian-news-href">
|
||||||
<p class="nowrap-multi">{{ $pos_c->title }}</p>
|
<p class="nowrap-multi">{{ $pos_c->title }}</p>
|
||||||
<p class="nowrap">{{ $pos_c->created_at->format('Y-m-d') }}</p>
|
|
||||||
|
<p class="nowrap">
|
||||||
|
{{-- {{ $pos_c->created_at->format('Y-m-d') }}--}}
|
||||||
|
</p>
|
||||||
</a>
|
</a>
|
||||||
@endif
|
@endif
|
||||||
</div>
|
</div>
|
||||||
@@ -122,7 +127,7 @@
|
|||||||
<a href="{{ $info->link }}" class="nowrap">
|
<a href="{{ $info->link }}" class="nowrap">
|
||||||
<i class="fa fa-chevron-circle-right"></i>
|
<i class="fa fa-chevron-circle-right"></i>
|
||||||
{{ $info->title }}
|
{{ $info->title }}
|
||||||
<span>{{ $info->created_at->format('Y-m-d') }}</span>
|
{{-- <span>{{ $info->created_at->format('Y-m-d') }}</span>--}}
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
@endforeach
|
@endforeach
|
||||||
|
|||||||
Reference in New Issue
Block a user