✨ feat(37需求): 评论引导记录
This commit is contained in:
@@ -57,7 +57,7 @@ export enum FRIEND_SHIP_SELECT {
|
||||
GET_FRIEND_VALUE = 'friendValue friendLv'
|
||||
}
|
||||
|
||||
export const ENTERY_ROLE_PICK = ['roleId', 'roleName', 'serverId', 'ce', 'topLineupCe', 'coin', 'lv', 'exp', 'vLv', 'gold', 'heros', 'jewels', 'artifacts', 'consumeGoods', 'title', 'teraphs', 'showLineup', 'heads', 'head', 'frames', 'frame', 'spines', 'spine', 'hasGuild', 'guildCode', 'todayZeroPoint', 'apJson', 'skins', 'totalPay', 'guide', 'hasInit', 'renameCnt', 'totalCost', 'guildName', 'isVip', 'createTime', 'ipLocation', 'activityItems', 'customerLink', 'isClosePush'];
|
||||
export const ENTERY_ROLE_PICK = ['roleId', 'roleName', 'serverId', 'ce', 'topLineupCe', 'coin', 'lv', 'exp', 'vLv', 'gold', 'heros', 'jewels', 'artifacts', 'consumeGoods', 'title', 'teraphs', 'showLineup', 'heads', 'head', 'frames', 'frame', 'spines', 'spine', 'hasGuild', 'guildCode', 'todayZeroPoint', 'apJson', 'skins', 'totalPay', 'guide', 'hasInit', 'renameCnt', 'totalCost', 'guildName', 'isVip', 'createTime', 'ipLocation', 'activityItems', 'customerLink', 'isClosePush', 'hasComment'];
|
||||
|
||||
export enum SURVEY_SELECT {
|
||||
FIND = '-__v -_id -surveyName -roleIndex -reward -mailContent -receivedRole -createdAt -updatedAt'
|
||||
|
||||
@@ -351,6 +351,9 @@ export default class Role extends BaseModel {
|
||||
// 是否打开推送
|
||||
@prop({ required: false })
|
||||
isClosePush: boolean;
|
||||
// 是否评论过
|
||||
@prop({ required: false })
|
||||
hasComment: boolean;
|
||||
|
||||
public static async findAllByUid(uid: number, getters = false, virtuals = true) {
|
||||
const role: RoleType[] = await RoleModel.find({ 'userInfo.uid': uid }).select('roleId roleName serverId head frame spine heads frames spines lv updatedAt createTime').lean({ getters, virtuals });
|
||||
@@ -850,6 +853,11 @@ export default class Role extends BaseModel {
|
||||
let role: RoleType = await RoleModel.findOneAndUpdate({ roleId }, { $set: { isClosePush } }, { new: true }).select('-_id roleId isClosePush').lean();
|
||||
return role;
|
||||
}
|
||||
|
||||
public static async setHasComment(roleId: string, hasComment: boolean) {
|
||||
let role: RoleType = await RoleModel.findOneAndUpdate({ roleId }, { $set: { hasComment } }, { new: true }).select('-_id roleId hasComment').lean();
|
||||
return role;
|
||||
}
|
||||
}
|
||||
|
||||
export const RoleModel = getModelForClass(Role);
|
||||
|
||||
Reference in New Issue
Block a user