修复数据库问题
This commit is contained in:
parent
a34012687d
commit
35a8e4bc69
@ -1,5 +1,7 @@
|
||||
package models
|
||||
|
||||
import "github.com/beego/beego/v2/core/logs"
|
||||
|
||||
type UserAdmin struct {
|
||||
ID int
|
||||
Content string
|
||||
@ -7,7 +9,9 @@ type UserAdmin struct {
|
||||
|
||||
func IsUserAdmin(id string) bool {
|
||||
user := UserAdmin{}
|
||||
logs.Info(id)
|
||||
db.Model(UserAdmin{}).Where(Content+" = ?", id).First(user)
|
||||
logs.Info(user.Content)
|
||||
if len(user.Content) > 0 {
|
||||
return true
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user