问卷:添加等级限制
This commit is contained in:
@@ -42,8 +42,8 @@ export default class Survey extends BaseModel {
|
||||
@prop({ required: true })
|
||||
isEnable: boolean; // 是否显示
|
||||
|
||||
public static async findEnableSurvey(select = '') {
|
||||
let rec: SurveyType[] = await SurveyModel.find({ isEnable: true, endTime: { $gte: nowSeconds() } }).select(select).lean();
|
||||
public static async findEnableSurvey(lv: number, select = '') {
|
||||
let rec: SurveyType[] = await SurveyModel.find({ isEnable: true, lv: { $lte: lv }, startTime: { $lte: nowSeconds() }, endTime: { $gte: nowSeconds() } }).select(select).lean();
|
||||
return rec;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user