fix:设置当前logo

This commit is contained in:
momo 2023-09-08 18:26:23 +08:00
parent bf9c6c9386
commit 37e0d03de1

View File

@ -149,14 +149,19 @@ func (l *UserLogoSetLogic) UserLogoSet(req *types.UserLogoSetReq, userinfo *auth
return err
}
userInfo.Metadata = &metadataBUserInfo
userInfo.Utime = &nowTime
if userInfo.Id == 0 {
// 新增
userInfo.Module = &module
userInfo.Ctime = &nowTime
userInfo.Utime = &nowTime
userInfo.UserId = &userId
userInfo.GuestId = &guestId
resCreate := tx.Model(&userInfo).Create(&userInfo)
err = resCreate.Error
} else {
// 更新
userInfo.Utime = &nowTime
resUpdates := tx.Model(&userInfo).Select("metadata").Where("id = ?", userInfo.Id).Updates(&userInfo)
err = resUpdates.Error
}