This commit is contained in:
laodaming 2023-10-12 18:29:47 +08:00
parent 2a1ceded61
commit 2c8b8b1aac

View File

@ -73,6 +73,9 @@ func (l *defaultImageHandle) LogoInfo(ctx context.Context, in *LogoInfoReq) (*Lo
var module = "profile" var module = "profile"
userInfoGorm := l.MysqlConn.Where("module = ?", module) userInfoGorm := l.MysqlConn.Where("module = ?", module)
userInfo := gmodel.FsUserInfo{} userInfo := gmodel.FsUserInfo{}
if in.UserId == 0 && in.GuestId == 0 {
userInfoGorm.Where("user_id = ? and guest_id = ?", in.UserId, in.GuestId)
} else {
if in.UserId > 0 { if in.UserId > 0 {
userInfoGorm.Where("user_id = ?", in.UserId) userInfoGorm.Where("user_id = ?", in.UserId)
userInfo.UserId = &in.UserId userInfo.UserId = &in.UserId
@ -80,6 +83,7 @@ func (l *defaultImageHandle) LogoInfo(ctx context.Context, in *LogoInfoReq) (*Lo
userInfoGorm.Where("guest_id = ?", in.GuestId) userInfoGorm.Where("guest_id = ?", in.GuestId)
userInfo.GuestId = &in.GuestId userInfo.GuestId = &in.GuestId
} }
}
resFirst := userInfoGorm.First(&userInfo) resFirst := userInfoGorm.First(&userInfo)
err := resFirst.Error err := resFirst.Error
if err != nil { if err != nil {