初步完成

This commit is contained in:
2020-09-11 10:27:23 +08:00
parent 9c6d4da51e
commit 49c3511dbe
43 changed files with 3437 additions and 1188 deletions

View File

@@ -0,0 +1,34 @@
<?php
namespace App\Http\Controllers;
use App\Models\Patent;
use App\Models\Category;
use Illuminate\Http\Request;
class PatentController extends Controller
{
//显示论文详情
public function show(Patent $patent)
{
$next = Patent::where('id', '>', $patent->id)->where('status', 1)->first();
return view('patents.show', compact('patent', 'next'));
}
//显示文章列表
public function list(Request $request)
{
$type = $request->type;
$patents = Patent::where('status', 1)
->when($type, function ($q) use ($type) {
$q->where('type', $type);
})
->paginate();
return view('patents.list', compact('patents'));
}
}