common\services\NotificationService::newReplyNotify PHP Method

newReplyNotify() public method

评论和@用户会有通知
public newReplyNotify ( User $fromUser, Topic $topic, PostComment $comment, $atUsers )
$fromUser common\models\User
$topic frontend\modules\topic\models\Topic
$comment common\models\PostComment
    public function newReplyNotify(User $fromUser, Topic $topic, PostComment $comment, $atUsers)
    {
        foreach ($topic->follower as $key => $value) {
            $users[$value->user_id] = $value->user_id;
        }
        // Notify mentioned users
        if (!$this->batchNotify('at', $fromUser, $atUsers, $topic, $comment)) {
            // 通知关注的用户
            $this->batchNotify('new_comment', $fromUser, $users, $topic, $comment);
        }
    }