测试转换问题
This commit is contained in:
parent
a2425d0fba
commit
7674792e37
@ -1,7 +1,5 @@
|
||||
package models
|
||||
|
||||
import "github.com/beego/beego/v2/core/logs"
|
||||
|
||||
type UserAdmin struct {
|
||||
ID int
|
||||
Content string `gorm:"unique"`
|
||||
@ -9,9 +7,7 @@ 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