This commit is contained in:
luying
2022-04-11 21:21:22 +08:00
parent c6ebb62c6a
commit cb243421ad
6 changed files with 15 additions and 10 deletions
+4 -1
View File
@@ -286,11 +286,14 @@ export async function checkFilterWords(word: string) {
}
export async function sendSurveyMail(code: string) {
console.log('***** sendSurveyMail', code);
let rec = await SurveyRecModel.findByCode(code);
if(!rec || rec.hasSentMail) return false;
console.log('***** sendSurveyMail hasSentMail', rec.hasSentMail);
let survey = await SurveyModel.receive(rec.surveyId, rec.roleId);
let survey = await SurveyModel.findBySurveyId(rec.surveyId);
if(!survey) return false;
console.log('***** sendSurveyMail survey', survey);
await sendMailByContent(MAIL_TYPE.SEND_MAIL, rec.roleId, { goods: survey.reward, params: [survey.mailContent] });
await sendMessageToUserWithSuc(rec.roleId, PUSH_ROUTE.DELETE_SURVEY, { code: rec.code });