问卷
This commit is contained in:
@@ -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
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user