go-wxhelper/service/adminuser/select.go
2024-01-19 12:06:30 +08:00

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
}