完成文档分类

This commit is contained in:
augushong
2021-03-29 12:33:31 +08:00
parent 6fd50e255d
commit a993db8781
11 changed files with 94 additions and 53 deletions

View File

@@ -16,14 +16,14 @@ class Index extends Common
*
* @return \think\Response
*/
public function index($post_id = 0)
public function index($post_id = 0,$category_id = 0)
{
$list_post = Post::quickSelect();
$list_post = Post::quickSelect();
if (empty($post_id)) {
$model_post = $list_post->first();
$model_post = $list_post->first()->post->first();
} else {
$model_post = $list_post->where('id', $post_id)->first();
$model_post = $list_post->where('id',$category_id)->column('post')[0]->where('id', $post_id)->first();
}
View::assign('model_post', $model_post);