feat:完善信息
This commit is contained in:
@ -66,20 +66,19 @@ func (c *Instance) SwitchIdentity(identity int) error {
|
||||
if c.SelectIdentity == identity {
|
||||
return nil
|
||||
}
|
||||
c.TenantID, c.ManageUID = 0, 0
|
||||
// 已存在相应的身份,更新最后
|
||||
if c.Identity&identity > 0 {
|
||||
mUserManage := model.NewUserManage()
|
||||
// 查询用户身份
|
||||
_, err := model2.FirstField(mUserManage.UserManage, []string{"id", "tenant_id", "name", "uuid"},
|
||||
isExist, err := model2.FirstField(mUserManage.UserManage, []string{"id", "tenant_id", "name", "uuid"},
|
||||
model2.NewWhere("uid", c.UID), model2.NewWhere("identity", identity))
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
// 查询用户身份信息
|
||||
now := time.Now()
|
||||
} else if isExist {
|
||||
now := time.Now()
|
||||
|
||||
if mUserManage.ID > 0 {
|
||||
if err = orm.GetDB().Transaction(func(tx *gorm.DB) error {
|
||||
if err = model2.UpdatesWhere(mUserManage.UserManage, map[string]interface{}{
|
||||
"selected": model2.UserManageSelectedForNo, "updated_at": now,
|
||||
|
Reference in New Issue
Block a user