问卷
This commit is contained in:
@@ -42,9 +42,6 @@ export default class Survey extends BaseModel {
|
||||
@prop({ required: true })
|
||||
isEnable: boolean; // 是否显示
|
||||
|
||||
@prop({ required: true, type: String })
|
||||
receivedRole: string[]; // 是否显示
|
||||
|
||||
public static async findEnableSurvey(select = '') {
|
||||
let rec: SurveyType[] = await SurveyModel.find({ isEnable: true, endTime: { $gte: nowSeconds() } }).select(select).lean();
|
||||
return rec;
|
||||
|
||||
@@ -29,6 +29,11 @@ export default class SurveyRec extends BaseModel {
|
||||
return rec;
|
||||
}
|
||||
|
||||
public static async findByRole(roleId: string) {
|
||||
let rec: SurveyRecType[] = await SurveyRecModel.find({ roleId }).lean();
|
||||
return rec;
|
||||
}
|
||||
|
||||
public static async findByCode(code: string) {
|
||||
let rec: SurveyRecType = await SurveyRecModel.findOne({ code }).lean();
|
||||
return rec;
|
||||
|
||||
Reference in New Issue
Block a user