给用户增加“备注”列
CI / verify (pull_request) Has been cancelled

This commit is contained in:
2026-08-25 10:09:05 +08:00
parent 5935024ea8
commit 282da24bc4
13 changed files with 66 additions and 44 deletions
@@ -37,6 +37,7 @@ function mapAdminUserRow(u: {
mergedIntoUserId: bigint | null;
wxOpenId: string | null;
nickname: string | null;
hqRemark: string | null;
status: number;
sourceType: string;
sourceRefId: bigint | null;
@@ -56,6 +57,7 @@ function mapAdminUserRow(u: {
wxOpenId: u.wxOpenId,
wechatVerified: !!u.wxOpenId,
nickname: u.nickname,
hqRemark: u.hqRemark,
status: u.status,
sourceType: u.sourceType,
sourceRefId: u.sourceRefId,
@@ -100,6 +102,7 @@ export class AdminUsersService {
mergedIntoUserId: true,
wxOpenId: true,
nickname: true,
hqRemark: true,
status: true,
sourceType: true,
sourceRefId: true,
@@ -188,14 +191,14 @@ export class AdminUsersService {
});
}
async updateUser(id: bigint, dto: { nickname: string }) {
async updateUser(id: bigint, dto: { hqRemark: string }) {
const user = await this.prisma.user.findUnique({ where: { id }, select: { id: true } });
if (!user) throw new NotFoundException('用户不存在');
const nickname = dto.nickname.trim() || null;
const hqRemark = dto.hqRemark.trim() || null;
const updated = await this.prisma.user.update({
where: { id },
data: { nickname },
select: { id: true, userNo: true, nickname: true },
data: { hqRemark },
select: { id: true, userNo: true, hqRemark: true },
});
return serializeBigInt(updated);
}