fusenapi/model/gmodel/fs_backend_user_logic.go

16 lines
561 B
Go
Raw Normal View History

2023-06-25 10:30:39 +00:00
package gmodel
import "context"
// TODO: 使用model的属性做你想做的
func (u *FsBackendUserModel) FindUserByEmail(ctx context.Context, emailname string) (resp FsBackendUser, err error) {
2023-08-30 03:04:54 +00:00
err = u.db.WithContext(ctx).Model(&FsBackendUser{}).Where("`email` = ?", emailname).Take(&resp).Error
2023-06-25 10:30:39 +00:00
return resp, err
}
func (u *FsBackendUserModel) FindUserById(ctx context.Context, Id int64) (resp FsBackendUser, err error) {
2023-08-30 03:04:54 +00:00
err = u.db.WithContext(ctx).Model(&FsBackendUser{}).Where("`id` = ? and status != ?", Id, 0).Take(&resp).Error
2023-06-25 10:30:39 +00:00
return resp, err
}