From 2c8b8b1aac401b21a1145e558910804d3d63289b Mon Sep 17 00:00:00 2001 From: laodaming <11058467+laudamine@user.noreply.gitee.com> Date: Thu, 12 Oct 2023 18:29:47 +0800 Subject: [PATCH] fix --- service/repositories/image_handle.go | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) 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