问卷
This commit is contained in:
@@ -17,7 +17,7 @@ import { sendUngotDividend } from '../../../services/auctionService';
|
||||
import { taflush } from '../../../services/sdkService';
|
||||
import { ActivityInRemote } from '../../../domain/activityField/activityField';
|
||||
import { pushCurrentTime } from '../../../services/auctionService';
|
||||
import { SurveyModel } from '../../../db/Survery';
|
||||
import { SurveyModel, SurveyUpdate } from '../../../db/Survery';
|
||||
import { getSurvey } from '../../../services/gmService';
|
||||
import { sendMessageToAllWithSuc } from '../../../services/pushService';
|
||||
let timer: NodeJS.Timer;
|
||||
@@ -389,12 +389,18 @@ export class GmHandler {
|
||||
}
|
||||
|
||||
async updateSurvey(msg: { code: string, surveyId: string, beginTim: number, endTime: number, isEnable: boolean, surverLink: string, surveyName: string, roleIndex: number, goods: string, mailContent: string }, session: BackendSession) {
|
||||
|
||||
let reward = JSON.parse(msg.goods);
|
||||
|
||||
let result = await SurveyModel.updateSurvey(msg.code, {...msg, reward}, SURVEY_SELECT.FIND);
|
||||
let update: SurveyUpdate = msg;
|
||||
if(msg.goods) {
|
||||
let reward = JSON.parse(msg.goods);
|
||||
update.reward = reward;
|
||||
}
|
||||
let origin = await SurveyModel.findByCode(msg.code);
|
||||
let result = await SurveyModel.updateSurvey(msg.code, update, SURVEY_SELECT.FIND);
|
||||
if(!result) return resResult(STATUS.WRONG_PARMS);
|
||||
await sendMessageToAllWithSuc(PUSH_ROUTE.UPDATE_SURVEY, { survey: result });
|
||||
|
||||
if(origin && origin.isEnable != result.isEnable) {
|
||||
await sendMessageToAllWithSuc(PUSH_ROUTE.UPDATE_SURVEY, { survey: result });
|
||||
}
|
||||
|
||||
return resResult(STATUS.SUCCESS);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user