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
+6 -4
View File
@@ -31,6 +31,7 @@ import { MonopolyData } from "../domain/activityField/monopolyField";
import { ActivityPopUpShopModel, ActivityPopUpShopModelType } from "../db/ActivityPopUpShop";
import { getActivitiesByType } from "./activity/activityService";
import { SurveyModel } from "../db/Survery";
import { SurveyRecModel } from "../db/SurveyRec";
// —————————————— 跑马灯 —————————————— //
// 初始
@@ -340,9 +341,10 @@ export async function getParamStr(activity: ActivityModelType, productID: string
export async function getSurvey(roleId: string) {
let surveys = await SurveyModel.findEnableSurvey(SURVEY_SELECT.ENTRY);
return surveys.filter(cur => cur.receivedRole?.indexOf(roleId) == -1).map(cur => {
delete cur.receivedRole;
return cur;
let surveys = await SurveyModel.findEnableSurvey(SURVEY_SELECT.FIND);
let recs = await SurveyRecModel.findByRole(roleId);
return surveys.filter(survey => {
let index = recs.findIndex(rec => rec.surveyId == survey.surveyId);
return index == -1
});
}