优化分类说明

This commit is contained in:
augushong
2020-08-18 12:28:19 +08:00
parent 9d08fe3b5d
commit 6f7d3a3672
3 changed files with 9 additions and 3 deletions

View File

@@ -21,10 +21,11 @@ class Index extends Common
{
//
$sub_category = [];
$current_category = [];
if(!empty($this->request->param('category_id'))){
$sub_category = Category::where('pid',$this->request->param('category_id'))->where('type',3)->select();
$current_category = Category::find($this->request->param('category_id'));
if(empty($this->request->param('sub_category_id'))){
$categorys = [$this->request->param('category_id')];
@@ -52,6 +53,7 @@ class Index extends Common
$list_post = $model_post->paginate();
View::assign('current_category',$current_category);
View::assign('sub_category',$sub_category);
View::assign('list_post',$list_post);