16 lines
539 B
Go
16 lines
539 B
Go
|
package gmodel
|
||
|
|
||
|
import "context"
|
||
|
|
||
|
// TODO: 使用model的属性做你想做的
|
||
|
|
||
|
func (u *FsBackendUserModel) FindUserByEmail(ctx context.Context, emailname string) (resp FsBackendUser, err error) {
|
||
|
err = u.db.WithContext(ctx).Model(&resp).Where("`email` = ?", emailname).Take(&resp).Error
|
||
|
return resp, err
|
||
|
}
|
||
|
|
||
|
func (u *FsBackendUserModel) FindUserById(ctx context.Context, Id int64) (resp FsBackendUser, err error) {
|
||
|
err = u.db.WithContext(ctx).Model(&resp).Where("`id` = ? and status != ?", Id, 0).Take(&resp).Error
|
||
|
return resp, err
|
||
|
}
|