This commit is contained in:
laodaming
2023-10-17 18:16:11 +08:00
parent b90f56502d
commit aa1ab9937a
2 changed files with 3 additions and 3 deletions

View File

@@ -79,9 +79,9 @@ func (m *FsUserInfoModel) GetProfile(ctx context.Context, pkey string, userId in
}
return info, nil
}
func (m *FsUserInfoModel) FindOneByUser(ctx context.Context, userId, guestId int64) (resp *FsUserInfo, err error) {
func (m *FsUserInfoModel) FindOneByUser(ctx context.Context, userId, guestId int64, module string) (resp *FsUserInfo, err error) {
if userId > 0 {
err = m.db.WithContext(ctx).Model(&FsUserInfo{}).Where("user_id = ?", userId).Take(&resp).Error
err = m.db.WithContext(ctx).Model(&FsUserInfo{}).Where("user_id = ? and module = ?", userId, module).Take(&resp).Error
} else {
err = m.db.WithContext(ctx).Model(&FsUserInfo{}).Where("user_id = ? and guest_id = ?", userId, guestId).Take(&resp).Error
}