调整领导班子
This commit is contained in:
@@ -35,7 +35,7 @@ class IndexController extends AdminController
|
||||
$grid->column('sort', '序号');
|
||||
$states = [
|
||||
'on' => ['value' => 1, 'text' => '打开', 'color' => 'primary'],
|
||||
'off' => ['value' => 2, 'text' => '关闭', 'color' => 'default'],
|
||||
'off' => ['value' => 0, 'text' => '关闭', 'color' => 'default'],
|
||||
];
|
||||
$grid->column('status', '状态')->switch($states);
|
||||
$grid->column('created_at', '创建时间');
|
||||
@@ -56,14 +56,27 @@ class IndexController extends AdminController
|
||||
'required' => '必须选择所属分类',
|
||||
'min' => '必须选择所属分类',
|
||||
]);
|
||||
|
||||
$form->textarea('description', '内容简介')->rules('max:350');
|
||||
|
||||
$form->list('subjoin', '附加')
|
||||
->help('只有领导班子需要添加');
|
||||
|
||||
$form->image('cover', '封面')
|
||||
->move('images/' . date('Y/m/d'))
|
||||
->removable()
|
||||
->uniqueName();
|
||||
|
||||
$form->ueditor('content', '文章内容')->rules('required', ['required' => '详情不能为空']);
|
||||
$form->number('sort', '序号')->default(0)->rules('required', ['required' => '序号必须填写'])->help('倒序优先');
|
||||
$form->number('sort', '序号')
|
||||
->default(0)->rules('required', ['required' => '序号必须填写'])
|
||||
->help('倒序优先');
|
||||
$states = [
|
||||
'on' => ['value' => 1, 'text' => '打开', 'color' => 'success'],
|
||||
'off' => ['value' => 0, 'text' => '关闭', 'color' => 'danger'],
|
||||
];
|
||||
|
||||
$form->switch('status', '状态')->states($states);
|
||||
|
||||
return $form;
|
||||
}
|
||||
|
||||
@@ -22,9 +22,9 @@ class HomeController extends Controller
|
||||
$column->append(Dashboard::environment());
|
||||
});
|
||||
|
||||
$row->column(4, function (Column $column) {
|
||||
$column->append(Dashboard::extensions());
|
||||
});
|
||||
// $row->column(4, function (Column $column) {
|
||||
// $column->append(Dashboard::extensions());
|
||||
// });
|
||||
|
||||
$row->column(4, function (Column $column) {
|
||||
$column->append(Dashboard::dependencies());
|
||||
|
||||
@@ -18,7 +18,7 @@ class CategoryController extends Controller
|
||||
if ($category->type == Category::TYPE_SHOW && $category->article_id) {
|
||||
return redirect("articles/" . $category->article_id);
|
||||
} else {
|
||||
$articles = $category->relations(Category::TYPE_ARTICLE)->latest()->paginate();
|
||||
$articles = $category->relations(Category::TYPE_ARTICLE)->where('status', 1)->latest()->paginate();
|
||||
$parent = $category;
|
||||
|
||||
if ($category->childrens->isEmpty() && $category->parent) {
|
||||
@@ -26,6 +26,9 @@ class CategoryController extends Controller
|
||||
}
|
||||
|
||||
$advert = Advert::where('category_id', 73)->first();
|
||||
if ($category->id == 4) {
|
||||
return view('category.list', compact('articles', 'category', 'parent', 'advert'));
|
||||
}
|
||||
|
||||
return view('category.show', compact('articles', 'category', 'parent', 'advert'));
|
||||
}
|
||||
|
||||
@@ -10,6 +10,14 @@ class Article extends Model
|
||||
|
||||
use HasOneCover, BelongsToCategory;
|
||||
|
||||
/**
|
||||
* 应进行类型转换的属性
|
||||
* @var array
|
||||
*/
|
||||
protected $casts = [
|
||||
'subjoin' => 'array',
|
||||
];
|
||||
|
||||
public function getLinkAttribute()
|
||||
{
|
||||
return route('article.show', $this);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,56 +1,63 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('title', $category->title)
|
||||
|
||||
@section('content')
|
||||
<!-- 详情 -->
|
||||
<div class="details">
|
||||
<div class="contant">
|
||||
<div class="page-left">
|
||||
<div class="pagelist">
|
||||
<h1>{{ $parent->title }}</h1>
|
||||
<ul class="listbox">
|
||||
@if ($parent->children->isNotEmpty())
|
||||
@foreach ($parent->children as $children)
|
||||
<li @if($category->id==$children->id) class="active" @endif>
|
||||
<a href="{{ $children->link }}">{{ $children->title }}</a>
|
||||
</li>
|
||||
@endforeach
|
||||
@endif
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="page-right">
|
||||
<div class="pagelujing">
|
||||
<div class="name">{{ $category->title }}</div>
|
||||
<span>
|
||||
您当前所在位置:<a href="/">首页</a> >
|
||||
@if ($category->id!=$parent->id)
|
||||
<a href="{{ $parent->link }}">{{ $parent->title }}</a> >
|
||||
@endif
|
||||
<a href="{{ $category->link }}">{{ $category->title }}</a>
|
||||
</span>
|
||||
</div>
|
||||
<div class="news-txt ny mg-t-b">
|
||||
<div class="news-con">
|
||||
<ul class="newslist ny">
|
||||
@if ($articles->isNotEmpty())
|
||||
@foreach ($articles as $article)
|
||||
<li>
|
||||
<a href="{{ $article->link }}">{{ $article->title }}</a><span>{{ $article->created_at->format('m-d') }}</span>
|
||||
</li>
|
||||
@endforeach
|
||||
@endif
|
||||
</ul>
|
||||
<div class="tcdPageCode">
|
||||
@if ($articles->isNotEmpty())
|
||||
{{ $articles->links('layouts.pagination') }}
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end 详情 -->
|
||||
@endsection
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('title', $category->title)
|
||||
|
||||
@section('content')
|
||||
<!-- 详情 -->
|
||||
<div class="details">
|
||||
<div class="contant">
|
||||
<div class="page-left">
|
||||
<div class="pagelist">
|
||||
<h1>{{ $parent->title }}</h1>
|
||||
<ul class="listbox">
|
||||
@if ($parent->children->isNotEmpty())
|
||||
@foreach ($parent->children as $children)
|
||||
<li @if($category->id==$children->id) class="active" @endif>
|
||||
<a href="{{ $children->link }}">{{ $children->title }}</a>
|
||||
</li>
|
||||
@endforeach
|
||||
@endif
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="page-right">
|
||||
<div class="pagelujing">
|
||||
<div class="name">{{ $category->title }}</div>
|
||||
<span>
|
||||
您当前所在位置:<a href="/">首页</a> >
|
||||
@if ($category->id!=$parent->id)
|
||||
<a href="{{ $parent->link }}">{{ $parent->title }}</a> >
|
||||
@endif
|
||||
<a href="{{ $category->link }}">{{ $category->title }}</a>
|
||||
</span>
|
||||
</div>
|
||||
<div class="news-txt ny mg-t-b">
|
||||
<div class="news-con">
|
||||
<ul class="leaderslist ny">
|
||||
@if ($articles->isNotEmpty())
|
||||
@foreach ($articles as $article)
|
||||
<li style="background-image: url({{ $article->cover_path }});">
|
||||
<a href="{{ $article->link }}">
|
||||
<div class="name"> {{ $article->title }} </div>
|
||||
@if ($article->subjoin)
|
||||
@foreach ($article->subjoin as $item)
|
||||
<div>{{ $item }}</div>
|
||||
@endforeach
|
||||
@endif
|
||||
</a>
|
||||
</li>
|
||||
@endforeach
|
||||
@endif
|
||||
</ul>
|
||||
<div class="tcdPageCode">
|
||||
@if ($articles->isNotEmpty())
|
||||
{{ $articles->links('layouts.pagination') }}
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end 详情 -->
|
||||
@endsection
|
||||
|
||||
@@ -37,7 +37,8 @@
|
||||
@if ($articles->isNotEmpty())
|
||||
@foreach ($articles as $article)
|
||||
<li>
|
||||
<a href="{{ $article->link }}">{{ $article->title }}</a><span>{{ $article->created_at->format('m-d') }}</span>
|
||||
<a href="{{ $article->link }}">{{ $article->title }}</a>
|
||||
<span>{{ $article->created_at->format('m-d') }}</span>
|
||||
</li>
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
<div class="ce-img oneCont-top-img">
|
||||
<span style="background-image: url({{ getArticlesBYCate(7,5)->first()->cover_path }});"></span>
|
||||
</div>
|
||||
<div class="oneCont-top-cont">
|
||||
<div class="oneCont-top-cont" data-href="{{ getArticlesBYCate(7,5)->first()->link }}">
|
||||
<div class="ce-nowrap oneCont-top-title">
|
||||
{{ getArticlesBYCate(7,5)->first()->title }}
|
||||
</div>
|
||||
@@ -31,8 +31,6 @@
|
||||
</div>
|
||||
<div class="oneCont-top-time">
|
||||
<span>{{ getArticlesBYCate(7,5)->first()->created_at->format('Y-m-d') }}</span>
|
||||
<div class="oneCont-top-more" data-href="{{ getArticlesBYCate(7,5)->first()->link }}">
|
||||
查看更多<img src="/assets/index/images/idxRow_color.png"></div>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="oneCont-ul">
|
||||
|
||||
Reference in New Issue
Block a user