文章可设置类型用于不同而类型

This commit is contained in:
augushong
2020-05-07 21:33:59 +08:00
parent 642dc3a568
commit c4dcc1f6b6
14 changed files with 57 additions and 42 deletions

View File

@@ -19,7 +19,7 @@ class Category extends Common
{
//
$list = ModelCategory::getListLevel();
$list = ModelCategory::getListLevel('',$this->request->param('type',1));
if($this->request->isAjax()){
return json_message($list);
@@ -39,7 +39,7 @@ class Category extends Common
{
//
$list = ModelCategory::getListLevel();
$list = ModelCategory::getListLevel('',$this->request->param('type',1));
View::assign('list_category',$list);
@@ -107,7 +107,7 @@ class Category extends Common
$model_category = ModelCategory::find($id);
$list = ModelCategory::getListLevel();
$list = ModelCategory::getListLevel('',$this->request->param('type',1));
View::assign('list_category',$list);
View::assign('category',$model_category);

View File

@@ -23,7 +23,10 @@ class Post extends Common
{
//
$list = ModelPost::with(['categorys.category','tags.tag'])->order('id desc')->paginate();
$list = ModelPost::with(['categorys.category','tags.tag'])
->where('type',$this->request->param('type',1))
->order('id desc')
->paginate();
View::assign('list', $list);

View File

@@ -19,7 +19,9 @@ class Tag extends Common
{
//
$list_tag = ModelTag::order('id desc')->paginate();
$list_tag = ModelTag::order('id desc')
->where('type',$this->request->param('type',1))
->paginate();
if($this->request->isAjax()){
return json_message($list_tag);