Merge branch 'develop' of gitee.com:fusenpack/fusenapi into develop

This commit is contained in:
laodaming
2023-09-05 16:35:10 +08:00
10 changed files with 43 additions and 32 deletions

View File

@@ -31,7 +31,7 @@ type UserBasicInfoForSave struct {
}
func (u *FsUserModel) FindUserByEmail(ctx context.Context, emailname string) (resp FsUser, err error) {
err = u.db.WithContext(ctx).Model(&FsUser{}).Where("`email` = ?", emailname).Take(&resp).Error
err = u.db.WithContext(ctx).Model(&FsUser{}).Where("`email` = ? and is_del = ?", emailname, 0).Take(&resp).Error
return resp, err
}
@@ -46,7 +46,7 @@ func (u *FsUserModel) FindUserByGoogleId(ctx context.Context, Id int64) (resp Fs
}
func (u *FsUserModel) Transaction(ctx context.Context, fc func(tx *gorm.DB) error) (err error) {
return u.db.WithContext(ctx).Transaction(fc)
return u.db.Model(&FsUser{}).WithContext(ctx).Transaction(fc)
}
// 继承guest_id的资源表