✨ feat(后台): 后台玩家查询、排行榜统计

This commit is contained in:
luying
2022-10-28 20:39:21 +08:00
parent 2155681dc3
commit 831b0b5602
6 changed files with 53 additions and 4 deletions
+5
View File
@@ -249,6 +249,11 @@ export default class User extends BaseModel {
return user;
}
public static async findUserByChannelRegex(channelId: string) {
const user: UserType = await UserModel.findOne({ channelId: { $regex: new RegExp(channelId.toString(), 'i') } }).select('uid token serverType auth tel userCode pkgName ip deviceId').lean({ getters: true });
return user;
}
public static async findTokenByTel(tel: string) {
const user: UserType = await UserModel.findOne({ tel }).lean();
return user ? user.token : null;
+1
View File
@@ -11,6 +11,7 @@ export interface SearchRoleParam {
roleId?: string; // 角色id
roleName?: string; // 昵称
tel?: string;
channelId?: string;
}
export interface SearchHeroParam {