package admin

import (
	"hongze/hongze_yb/global"
)

// GetByAdminId 根据admin_id获取系统用户信息
func GetByAdminId(adminId int) (item *Admin, err error) {
	err = global.DEFAULT_MYSQL.Where("admin_id =  ? ", adminId).First(&item).Error
	return
}

// GetAdminByMobile 通过手机号获取系统用户信息
func GetAdminByMobile(mobile string) (item *Admin, err error) {
	err = global.DEFAULT_MYSQL.Model(Admin{}).Where("mobile = ? AND enabled = 1", mobile).First(&item).Error
	return
}

// GetAdminByEmail 通过邮箱获取系统用户信息
func GetAdminByEmail(mobile string) (item *Admin, err error) {
	err = global.DEFAULT_MYSQL.Model(Admin{}).Where("email = ? AND enabled = 1", mobile).First(&item).Error
	return
}

// GetVWangInfo 获取沛总的账户信息
func GetVWangInfo() (item *Admin, err error) {
	return GetByAdminId(66)
}
