更新指定更新XXX账号指令 开放ptkey过期提醒

This commit is contained in:
ZJY 2021-09-09 15:48:21 +08:00
parent 534752aa9c
commit 7950f58d55

View File

@ -1,5 +1,7 @@
package models
import "github.com/beego/beego/v2/core/logs"
type UserAdmin struct {
ID int
Content string `gorm:"unique"`
@ -7,9 +9,7 @@ type UserAdmin struct {
func IsUserAdmin(id string) bool {
user := UserAdmin{}
logs.Info(id)
db.Model(UserAdmin{}).Where(Content+" = ?", id).First(user)
if len(user.Content) > 0 {
return true
}
return false
}