public function atNotify($isThread, $data) { $content = $data["content"]; $users = ToolModel::detectAtUsers($content); if ($isThread == 1) { $thread = $data; $actionUser = $data["createby"]; } else { $thread = $this->threadById($data["threadid"]); $actionUser = $data["name"]; } $userModel = new UserModel(); foreach ($users as $user) { $userid = $userModel->useridByName($user); $userInfo = $userModel->userInfo($userid); if ($userInfo) { if ($userInfo["emailatnotification"] == 1) { $this->atNotifyMail($isThread, $user, $userInfo["email"], $thread, $content, $actionUser); } } } }