静态资源

This commit is contained in:
2020-09-16 08:35:46 +08:00
parent 24315e4798
commit ac3b53b163
40 changed files with 8270 additions and 660 deletions

View File

@@ -10,7 +10,7 @@ class CategoryController extends Controller
/**
* 显示分类
* @param Category $category [description]
* @param Category $category [description]
* @return [type] [description]
*/
public function index(Category $category)
@@ -18,15 +18,15 @@ class CategoryController extends Controller
if ($category->type == Category::TYPE_SHOW && $category->article_id) {
return redirect("articles/" . $category->article_id);
} else {
$articles = $category->relations(Category::TYPE_ARTICLE)->paginate();
$articles = $category->relations(Category::TYPE_ARTICLE)->paginate(8);
$parent = $category;
if ($category->childrens->isEmpty()) {
$parent = $category->parent;
}
$advert = Advert::where('category_id',73)->first();
$advert = Advert::where('category_id', 73)->first();
return view('category.show', compact('articles', 'category', 'parent','advert'));
return view('category.show', compact('articles', 'category', 'parent', 'advert'));
}
}