31 lines
691 B
PHP
31 lines
691 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use App\Models\Advert;
|
|
use App\Models\Article;
|
|
|
|
class ArticleController extends Controller
|
|
{
|
|
|
|
/**
|
|
* 显示分类
|
|
* @param Category $category [description]
|
|
* @return [type] [description]
|
|
*/
|
|
public function show(Article $article)
|
|
{
|
|
$category = $article->category;
|
|
$parent = getTopCate($category->id);
|
|
|
|
$next = Article::where('id', '>', $article->id)
|
|
->where('category_id', $article->category_id)
|
|
->where('status', 1)
|
|
->first();
|
|
|
|
return view('article.show', compact('article', 'next', 'parent'));
|
|
|
|
}
|
|
|
|
}
|