From f3f1424cfa650dce823a348d6519ef4ad1e25dfd Mon Sep 17 00:00:00 2001 From: Jerry Yan <792602257@qq.com> Date: Thu, 28 May 2020 13:09:39 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hyhproject/app/controller/Note.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/hyhproject/app/controller/Note.php b/hyhproject/app/controller/Note.php index 2c2722d..9fbffb0 100644 --- a/hyhproject/app/controller/Note.php +++ b/hyhproject/app/controller/Note.php @@ -43,6 +43,12 @@ class Note extends Base ]); return WSTReturn("成功", 1); }elseif($id == 0){ + model("note")->save([ + "title"=>$title, + "content"=>$content, + "user_id"=>$userId, + "id"=>$id + ]); return WSTReturn("成功", 1); } return WSTReturn("异常请求",0); @@ -50,7 +56,10 @@ class Note extends Base public function creditIndex(){ $userId = (int)session('WST_USER.userId'); - + $model = model("note_credit")->field(true) + ->where(["user_id"=>$userId])->order("update_time", "desc") + ->select(); + return WSTReturn("OK", 1, $model); } public function creditDetail(){