初始化应用

This commit is contained in:
augushong
2020-08-08 22:02:18 +08:00
parent 3bc46a4b9c
commit d263417b51
34 changed files with 181 additions and 1411 deletions

View File

@@ -5,6 +5,7 @@ declare(strict_types=1);
namespace app\index\controller;
use app\model\Post as ModelPost;
use think\facade\View;
use think\Request;
class Post extends Common
@@ -52,23 +53,12 @@ class Post extends Common
$model_post = ModelPost::find($id);
$this->assign('post', $model_post);
View::assign('post', $model_post);
return $this->fetch();
return View::fetch();
}
public function __documentsRead()
{
$category_id = $this->request->param('category_id',0);
$list_post = [];
if(!empty($category_id)){
$list_post = ModelPost::hasWhere('categorys',['category_id'=>$category_id])->order('sort desc')->select();
}
$this->assign('list_post',$list_post);
}
/**
* 显示编辑资源表单页.