微调
This commit is contained in:
@@ -57,6 +57,8 @@ class IndexController extends AdminController
|
||||
$form->number('order', '排序')->default(0);
|
||||
$form->switch('top_show', '顶部导航显示')->states()->default(0);
|
||||
$form->switch('status', '显示')->states()->default(1);
|
||||
$form->text('url', '跳转地址')->help('设置后直接跳转到设置的url');
|
||||
|
||||
$form->action(admin_url('categories'));
|
||||
|
||||
$column->append((new Box('新增分类', $form))->style('success'));
|
||||
@@ -121,6 +123,7 @@ class IndexController extends AdminController
|
||||
|
||||
$form->switch('status', '显示')->states()->default(1);
|
||||
$form->switch('top_show', '顶部导航显示')->states();
|
||||
$form->text('url', '跳转地址')->help('设置后直接跳转到设置的url');
|
||||
|
||||
$form->saving(function (Form $form) {
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ class PatentController extends Controller
|
||||
//显示文章列表
|
||||
public function list(Request $request)
|
||||
{
|
||||
$type = $request->type;
|
||||
$type = $request->type ?? 'paper';
|
||||
$title = $request->title;
|
||||
$number = $request->number;
|
||||
$category_id = $request->category_id;
|
||||
@@ -54,7 +54,7 @@ class PatentController extends Controller
|
||||
->latest()
|
||||
->paginate();
|
||||
|
||||
return view('patents.list', compact('patents'));
|
||||
return view('patents.list', compact('patents', 'type'));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -26,6 +26,10 @@ class Category extends Model
|
||||
|
||||
public function getLinkAttribute()
|
||||
{
|
||||
if ($this->url) {
|
||||
return $this->url;
|
||||
}
|
||||
|
||||
return route('category.show', $this);
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<i class="fa fa-caret-right"></i>
|
||||
<a href="{{ url()->current() }}">{{ request()->type=='patent'?'专利':'论文' }}</a>
|
||||
</div>
|
||||
@include('patents.'.request()->type, ['patents' => $patents])
|
||||
@include('patents.'.$type, ['patents' => $patents])
|
||||
<!-- 分页 -->
|
||||
<div class="pages">
|
||||
@if ($patents->isNotEmpty())
|
||||
|
||||
Reference in New Issue
Block a user