新增头部和导航

This commit is contained in:
augushong
2021-03-29 00:03:26 +08:00
parent 7f98d5e8c9
commit 6fd50e255d
10 changed files with 263 additions and 40 deletions

View File

@@ -31,10 +31,10 @@ class Post extends Common
{
//
$list = ModelPost::with(['categorys.category','tags.tag'])
->where('type',$this->request->param('type',1))
->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);
@@ -50,6 +50,9 @@ class Post extends Common
{
//
$list_category = Category::where('status', 1)->order('sort asc')->select();
View::assign('list_category', $list_category);
return View::fetch();
}
@@ -90,7 +93,7 @@ class Post extends Common
]);
}
return $this->success('添加成功',url('index',['type'=>$this->request->param('type')]));
return $this->success('添加成功', url('index', ['type' => $this->request->param('type')]));
}
/**
@@ -188,7 +191,7 @@ class Post extends Common
}
}
return $this->success('保存成功', url('index',['type'=>$model_post->getData('type')]));
return $this->success('保存成功', url('index', ['type' => $model_post->getData('type')]));
}
/**
@@ -205,9 +208,9 @@ class Post extends Common
$model_post->delete();
PostCategory::where('post_id',$id)->delete();
PostCategory::where('post_id', $id)->delete();
PostTag::where('post_id',$id)->delete();
PostTag::where('post_id', $id)->delete();
return json_message();
}

View File

@@ -18,10 +18,6 @@ class Index extends Common
*/
public function index($post_id = 0)
{
//
$list_post = Post::quickSelect();
if (empty($post_id)) {
@@ -30,7 +26,6 @@ class Index extends Common
$model_post = $list_post->where('id', $post_id)->first();
}
View::assign('model_post', $model_post);
View::assign('list_post', $list_post);