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