玩家信息:改名花费

This commit is contained in:
luying
2021-09-30 11:01:16 +08:00
parent 4ed0b8251e
commit 78159dedd3
3 changed files with 18 additions and 4 deletions

View File

@@ -320,6 +320,10 @@ export default class Role extends BaseModel {
@prop({ required: true, default: [], type: Number })
guide: number[]; // 已领取奖励
@prop({ required: true })
renameCnt: number; // 改名次数
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').lean({ getters, virtuals });
return role;
@@ -733,7 +737,7 @@ export const RoleModel = getModelForClass(Role);
export interface RoleType extends Pick<DocumentType<Role>, keyof Role> { };
export type RoleUpdate = Partial<RoleType>; // 将所有字段变成可选项
export type RoleInc = Partial<Pick<DocumentType<Role>, 'heroNum' | 'blockCnt' | 'friendCnt' | 'gold' | 'coin' | 'ce'>>;
export type RoleInc = Partial<Pick<DocumentType<Role>, 'heroNum' | 'blockCnt' | 'friendCnt' | 'gold' | 'coin' | 'ce' | 'renameCnt'>>;
// 初始化
function getInitialTeraph() {