问卷
This commit is contained in:
@@ -11,11 +11,13 @@ import { GuildModel } from "../db/Guild";
|
||||
import { getRoleOnlineInfo, updateUserInfo } from "./redisService";
|
||||
import { Application, pinus } from "pinus";
|
||||
import { getGuildChannelSid } from "./chatService";
|
||||
import { getRandSingleEelm, readWordTxt, resResult, writeWordTxt } from "../pubUtils/util";
|
||||
import { getRandSingleEelm, parseGoodStr, readWordTxt, resResult, writeWordTxt } from "../pubUtils/util";
|
||||
const ThinkingAnalytics = require("thinkingdata-node");
|
||||
import Trie from '../pubUtils/trie';
|
||||
import _ = require("underscore");
|
||||
import { getGoldObject } from "./role/rewardService";
|
||||
import { SurveyRecModel } from "../db/SurveyRec";
|
||||
import { SurveyModel } from "../db/Survery";
|
||||
|
||||
// 检查私聊是否合法
|
||||
|
||||
@@ -283,4 +285,17 @@ export async function checkFilterWords(word: string) {
|
||||
let server = getRandSingleEelm(servers);
|
||||
return await pinus.app.rpc.chat.chatRemote.checkFilterWords.toServer(server.id, word);
|
||||
}
|
||||
}
|
||||
|
||||
export async function sendSurveyMail(code: string) {
|
||||
let rec = await SurveyRecModel.findByCode(code);
|
||||
if(!rec || rec.hasSentMail) return false;
|
||||
|
||||
let survey = await SurveyModel.findBySurveyId(rec.surveyId);
|
||||
if(!survey) return false;
|
||||
|
||||
let reward = parseGoodStr(survey.reward);
|
||||
|
||||
await sendMailByContent(MAIL_TYPE.SEND_MAIL, rec.roleId, { goods: reward, params: [survey.mailContent] });
|
||||
rec = await SurveyRecModel.send(rec.code);
|
||||
}
|
||||
Reference in New Issue
Block a user