commentModel = new UserComment(); } public function index(){ $data = decode($this->request->post()); $user = $data['u']; $page = $data['p']; $type = $data['t']; $info = $this->commentModel->getInfo($user, $type, $page); return json(["l"=>$info]); } public function comment(){ $data = decode($this->request->post()); $user = $data['u']; $comment = $data['c']; $content = $data['i']; $type = $data['t']; $data = ['id'=>getId(), 'user_id'=>$user, 'comment_id'=>$comment, 'content'=>$content, 'type'=>$type]; $this->commentModel->add($data); return json(['error'=>0]); } }