diff --git a/service/repositories/image_handle.go b/service/repositories/image_handle.go index a5dc2c71..550854e2 100644 --- a/service/repositories/image_handle.go +++ b/service/repositories/image_handle.go @@ -73,12 +73,16 @@ func (l *defaultImageHandle) LogoInfo(ctx context.Context, in *LogoInfoReq) (*Lo var module = "profile" userInfoGorm := l.MysqlConn.Where("module = ?", module) userInfo := gmodel.FsUserInfo{} - if in.UserId > 0 { - userInfoGorm.Where("user_id = ?", in.UserId) - userInfo.UserId = &in.UserId + if in.UserId == 0 && in.GuestId == 0 { + userInfoGorm.Where("user_id = ? and guest_id = ?", in.UserId, in.GuestId) } else { - userInfoGorm.Where("guest_id = ?", in.GuestId) - userInfo.GuestId = &in.GuestId + if in.UserId > 0 { + userInfoGorm.Where("user_id = ?", in.UserId) + userInfo.UserId = &in.UserId + } else { + userInfoGorm.Where("guest_id = ?", in.GuestId) + userInfo.GuestId = &in.GuestId + } } resFirst := userInfoGorm.First(&userInfo) err := resFirst.Error