From 5f0170df9787c6f3ff17cc168b3f2e3f511453f6 Mon Sep 17 00:00:00 2001
From: zhangqian <zhangqian@123.com>
Date: 星期二, 31 十月 2023 20:04:16 +0800
Subject: [PATCH] 支持职级降级的情况
---
model/user.go | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/model/user.go b/model/user.go
index b931f71..b67dada 100644
--- a/model/user.go
+++ b/model/user.go
@@ -26,7 +26,7 @@
MenuIds []uint `json:"menuIds" gorm:"-"` // 鑿滃崟ID鍒楄〃
AuthorityId uint `json:"authorityId" gorm:"default:888;comment:鐢ㄦ埛瑙掕壊ID"` // 鐢ㄦ埛瑙掕壊ID
Authority Authority `json:"authority" gorm:"foreignKey:AuthorityId"`
- SubUserIds string `json:"subUserIds" gorm:"sub_user_ids"` //涓嬪睘鍛樺伐鐢ㄦ埛id,鐢ㄩ�楀彿鍒嗗紑
+ SubUserIds *string `json:"subUserIds" gorm:"sub_user_ids"` //涓嬪睘鍛樺伐鐢ㄦ埛id,鐢ㄩ�楀彿鍒嗗紑
gorm.Model `json:"-"`
}
@@ -303,7 +303,7 @@
} else if old.Username != record.Username ||
old.UserType != record.UserType ||
old.NickName != record.NickName ||
- record.SubUserIds != "" && old.SubUserIds != record.SubUserIds {
+ record.SubUserIds != nil && old.SubUserIds != record.SubUserIds {
old.Username = record.Username
old.UserType = record.UserType
old.NickName = record.NickName
--
Gitblit v1.8.0