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(){