调整野蛮
This commit is contained in:
@@ -15,14 +15,21 @@ class ArticleController extends Controller
|
||||
*/
|
||||
public function show(Article $article)
|
||||
{
|
||||
// $parent = $category = $article->category;
|
||||
// $parent = $category = $article->category;
|
||||
// if ($category->childrens->isEmpty()) {
|
||||
// $parent = $category->parent;
|
||||
// }
|
||||
// $advert = Advert::where('category_id',73)->first();
|
||||
$categories = $article->categories;
|
||||
$parent = [];
|
||||
|
||||
return view('article.show', compact('article'));
|
||||
// return view('article.show', compact('article', 'parent', 'category','advert'));
|
||||
foreach ($categories as $category) {
|
||||
$top = getTopCate($category->id);
|
||||
$parent[] = $top->id;
|
||||
}
|
||||
|
||||
return view('article.show', compact('article', 'parent'));
|
||||
// return view('article.show', compact('article', 'parent', 'category','advert'));
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user