调整野蛮

This commit is contained in:
2021-04-07 13:18:18 +08:00
parent 96793afeec
commit ae95c5540b
14 changed files with 2170 additions and 808 deletions

View File

@@ -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'));
}