后台添加修改密码、编辑、记录等功能

This commit is contained in:
luying
2020-09-22 15:14:00 +08:00
parent 780562979e
commit 9f57e52445
8 changed files with 113 additions and 12 deletions
+5
View File
@@ -32,6 +32,11 @@ export default class GMGroup extends BaseModel {
return result;
}
public static async editGroup(groupId: number, group: string, name: string, desc: string, lean = true) {
const result = await GMGroupModel.findOneAndUpdate({ id: groupId }, {$set: {group, desc, name}}).select('uid username name').lean(lean);
return result;
}
public static async getAllGroup(lean = true) {
const list = await GMGroupModel.find().lean(lean);
return list;