コード例 #1
0
 public function actionUpdate()
 {
     $values = $this->getParams();
     $values['content'] = trim($values['content'], ',');
     $id = $values['id'];
     unset($values['id']);
     $defaults = ['userid' => $this->user->id, 'username' => $this->user->login_name, 'updatetime' => time()];
     $comment = new Comment();
     $flag = $comment->updateComm(array_merge($values, $defaults), ['id' => $id]);
     if ($flag) {
         $this->redirect('/basedata/comment/index');
     }
 }