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
@@ -60,6 +60,5 @@ export enum FRIEND_SHIP_SELECT {
export const ENTERY_ROLE_PICK = ['roleId', 'roleName', 'serverId', 'ce', 'topLineupCe', 'coin', 'lv', 'exp', 'vLv', 'gold', 'heros', 'jewels', 'consumeGoods', 'title', 'teraphs', 'showLineup', 'heads', 'head', 'frames', 'frame', 'spines', 'spine', 'hasGuild', 'guildCode', 'todayZeroPoint', 'apJson', 'skins', 'totalPay', 'guide', 'hasInit', 'renameCnt', 'totalCost', 'guildName', 'isVip'];
export enum SURVEY_SELECT {
ENTRY = '-__v -_id -surveyId -surveyName -roleIndex -reward -mailContent -createdAt -updatedAt',
FIND = '-__v -_id -surveyId -surveyName -roleIndex -reward -mailContent -receivedRole -createdAt -updatedAt'
}
-3
View File
@@ -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;
+5
View File
@@ -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;