问卷:添加等级限制
This commit is contained in:
@@ -205,7 +205,7 @@ async function getModuleData(type: string, data: { role: RoleType, session: Fron
|
||||
case 'chapter':
|
||||
return getMainChapter(role);
|
||||
case 'survey':
|
||||
return await getSurvey(role.roleId);
|
||||
return await getSurvey(role.roleId, role.lv);
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -340,8 +340,8 @@ export async function getParamStr(activity: ActivityModelType, productID: string
|
||||
}
|
||||
|
||||
|
||||
export async function getSurvey(roleId: string) {
|
||||
let surveys = await SurveyModel.findEnableSurvey(SURVEY_SELECT.FIND);
|
||||
export async function getSurvey(roleId: string, lv: number) {
|
||||
let surveys = await SurveyModel.findEnableSurvey(lv, SURVEY_SELECT.FIND);
|
||||
let recs = await SurveyRecModel.findByRole(roleId);
|
||||
return surveys.filter(survey => {
|
||||
let index = recs.findIndex(rec => rec.surveyId == survey.surveyId);
|
||||
|
||||
Reference in New Issue
Block a user