forked from lxh/go-wxhelper
20 lines
433 B
Go
20 lines
433 B
Go
package adminuser
|
|
|
|
import (
|
|
"wechat-robot/internal/database"
|
|
"wechat-robot/model/entity"
|
|
)
|
|
|
|
// GetUserWithLogin
|
|
// @description: 根据账号获取用户信息
|
|
// @param account
|
|
// @return record
|
|
// @return err
|
|
func GetUserWithLogin(account string) (record entity.AdminUser, err error) {
|
|
err = database.Client.
|
|
Where("username = ?", account).
|
|
Or("email = ? AND is_verified IS TRUE", account).
|
|
First(&record).Error
|
|
return
|
|
}
|