mirror of
https://gitee.com/ulthon/ulthon_information.git
synced 2026-03-04 00:24:29 +08:00
增加通用开头功能
This commit is contained in:
@@ -27,12 +27,19 @@ class Post extends Common
|
||||
{
|
||||
//
|
||||
|
||||
$list = ModelPost::with(['categorys.category', 'tags.tag'])
|
||||
$model_list = ModelPost::with(['categorys.category', 'tags.tag'])
|
||||
->where('type', $this->request->param('type', 1))
|
||||
->order('id desc')
|
||||
->paginate([
|
||||
'query' => $this->request->get()
|
||||
]);
|
||||
->order('id desc');
|
||||
|
||||
$category_id = $this->request->param('category_id', 0);
|
||||
|
||||
if(!empty($category_id)){
|
||||
$model_list = $model_list->where('category_id', $category_id);
|
||||
}
|
||||
|
||||
$list = $model_list->paginate([
|
||||
'query' => $this->request->get()
|
||||
]);
|
||||
|
||||
View::assign('list', $list);
|
||||
|
||||
@@ -90,7 +97,10 @@ class Post extends Common
|
||||
]);
|
||||
}
|
||||
|
||||
return $this->success('添加成功', url('index', ['type' => $this->request->param('type')]));
|
||||
return $this->success('添加成功', url('index', [
|
||||
'type' => $this->request->param('type'),
|
||||
'category_id'=>$this->request->param('category_id'),
|
||||
]));
|
||||
}
|
||||
|
||||
public function convertHtml2Markdown()
|
||||
|
||||
Reference in New Issue
Block a user