This commit is contained in:
2021-07-20 16:44:56 +08:00
parent 8ac9b9fd58
commit 627c17122f
9 changed files with 72 additions and 70 deletions

View File

@@ -11,7 +11,7 @@ class CategoryController extends Controller
/**
* 显示分类
* @param Category $category [description]
* @return [type] [description]
* @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector|\Illuminate\View\View [type] [description]
*/
public function index(Category $category)
{
@@ -24,7 +24,8 @@ class CategoryController extends Controller
}
$articles = $category->relations(Category::TYPE_ARTICLE)
->where('status', 1)
->latest()
->latest('sort')
->latest('created_at')
->paginate(8);
$parent = $category;