完成基本框架的搭建

This commit is contained in:
augushong
2021-03-23 19:06:10 +08:00
parent c76cfa3ae1
commit bb714a5333
10 changed files with 153 additions and 162 deletions

View File

@@ -16,10 +16,23 @@ class Index extends Common
*
* @return \think\Response
*/
public function index()
public function index($post_id = 0)
{
//
$list_post = Post::where('status', 1)->order('sort desc')->select();
if (empty($post_id)) {
$model_post = $list_post->first();
} else {
$model_post = $list_post->where('id', $post_id)->first();
}
View::assign('model_post', $model_post);
View::assign('list_post', $list_post);
return View::fetch();
}