From 3f385526a12572ee11a80dae285c4b8eadb0c42b Mon Sep 17 00:00:00 2001 From: liyukun <1099438829@qq.com> Date: Thu, 4 Nov 2021 00:02:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E7=95=99=E8=A8=80=E5=92=8C?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=96=87=E4=BB=B6=E7=95=99=E8=A8=80=E5=AE=A1?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/controller/Article.php | 53 ++++++ app/admin/controller/Message.php | 2 +- app/admin/view/article/comment.html | 267 ++++++++++++++++++++++++++++ app/admin/view/article/index.html | 3 +- app/admin/view/message/index.html | 8 +- app/common/model/Comment.php | 26 ++- app/common/model/MessageForm.php | 2 +- app/index/controller/Index.php | 2 +- 8 files changed, 354 insertions(+), 9 deletions(-) create mode 100644 app/admin/view/article/comment.html diff --git a/app/admin/controller/Article.php b/app/admin/controller/Article.php index 4d4c1bc..eed0dfa 100644 --- a/app/admin/controller/Article.php +++ b/app/admin/controller/Article.php @@ -5,6 +5,7 @@ namespace app\admin\controller; use app\common\model\Document as aModel; use app\common\model\DocumentCategory as cModel; use app\common\model\DocumentArticle; +use app\common\model\Comment as CommentModel; use app\Request; use app\admin\service\UtilService as Util; use think\Exception; @@ -203,4 +204,56 @@ class Article extends AuthController $this->assign("info",$info); return $this->fetch(); } + + /** + * 文章管理主页 + * @return string + * @throws \Exception + */ + public function comment($article_id ='') + { + return $this->fetch(); + } + + /** + * 文章评论列表 + * @return mixed + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException + * @author 李玉坤 + * @date 2021-11-03 23:28 + */ + public function commentList() + { + $where = Util::postMore([ + ['document_id',''], + ['name',''], + ['tel',''], + ['email',''], + ['start_time',''], + ['end_time',''], + ['page',1], + ['limit',20], + ]); + if ($where['document_id'] == "") return app("json")->fail("参数错误"); + return app("json")->layui(CommentModel::systemPage($where)); + } + + + /** + * 修改字段 + * @param $id + * @return mixed + * @author 李玉坤 + * @date 2021-02-16 23:12 + */ + public function commentField($id) + { + if (!$id) return app("json")->fail("参数有误,Id为空!"); + $where = Util::postMore([['field',''],['value','']]); + if ($where['field'] == '' || $where['value'] =='') return app("json")->fail("参数有误!"); + return CommentModel::update([$where['field']=>$where['value']],['id'=>$id]) ? app("json")->success("操作成功") : app("json")->fail("操作失败"); + } + } \ No newline at end of file diff --git a/app/admin/controller/Message.php b/app/admin/controller/Message.php index caf5707..34aed63 100644 --- a/app/admin/controller/Message.php +++ b/app/admin/controller/Message.php @@ -49,7 +49,7 @@ class Message extends AuthController public function lst(Request $request) { $where = Util::postMore([ - ['name',''], + ['author',''], ['tel',''], ['email',''], ['start_time',''], diff --git a/app/admin/view/article/comment.html b/app/admin/view/article/comment.html new file mode 100644 index 0000000..6f14ead --- /dev/null +++ b/app/admin/view/article/comment.html @@ -0,0 +1,267 @@ + + +
+