mirror of
https://gitee.com/ulthon/layui-ul.git
synced 2026-07-01 10:32:49 +08:00
新增头部和导航
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user