文章关联多分类
This commit is contained in:
@@ -10,18 +10,19 @@ class ArticleController extends Controller
|
||||
|
||||
/**
|
||||
* 显示分类
|
||||
* @param Category $category [description]
|
||||
* @return [type] [description]
|
||||
* @param \App\Models\Article $article
|
||||
* @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\View\View [type] [description]
|
||||
*/
|
||||
public function show(Article $article)
|
||||
{
|
||||
$parent = $category = $article->category;
|
||||
if ($category->childrens->isEmpty()) {
|
||||
$parent = $category->parent;
|
||||
}
|
||||
$advert = Advert::where('category_id',73)->first();
|
||||
// $parent = $category = $article->category;
|
||||
// if ($category->childrens->isEmpty()) {
|
||||
// $parent = $category->parent;
|
||||
// }
|
||||
// $advert = Advert::where('category_id',73)->first();
|
||||
|
||||
return view('article.show', compact('article', 'parent', 'category','advert'));
|
||||
return view('article.show', compact('article'));
|
||||
// return view('article.show', compact('article', 'parent', 'category','advert'));
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user