fix
This commit is contained in:
parent
ce413c494c
commit
b95c2f90d5
|
@ -80,6 +80,10 @@ 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) {
|
||||
err = m.db.WithContext(ctx).Model(&FsUserInfo{}).Where("user_id = ? and guest_id = ?", userId, guestId).Take(&resp).Error
|
||||
if userId > 0 {
|
||||
err = m.db.WithContext(ctx).Model(&FsUserInfo{}).Where("user_id = ?", userId).Take(&resp).Error
|
||||
} else {
|
||||
err = m.db.WithContext(ctx).Model(&FsUserInfo{}).Where("user_id = ? and guest_id = ?", userId, guestId).Take(&resp).Error
|
||||
}
|
||||
return resp, err
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user