public function afterSave($insert, $changedAttributes) { if ($insert === true) { (new History(['user_id' => $this->user_id, 'action' => History::ACTION_ADD_COMMENT, 'action_time' => $this->created_at, 'target' => $this->id]))->save(false); Siteinfo::updateCounterInfo('addComment'); UserInfo::updateCounterInfo('addComment', $this->user_id); Topic::afterCommentInsert($this->topic_id, $this->user_id); Notice::afterCommentInsert($this); } return parent::afterSave($insert, $changedAttributes); }