package models import ( "ppgo/common" "time" ) type App struct { BaseOrm ID int64 `json:"id" gorm:"id"` AppKey string `json:"app_key"` Password string `json:"password"` Name string `json:"name"` Remark string `json:"remark"` EndAt time.Time `json:"end_at"` // 截止时间 CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` } // TableName 表名称 func (*App) TableName() string { return "app" } func FindByAppKey(appKey string) *App { a := &App{} common.GetDb().Where("app_key", appKey).First(&a) if a.ID == 0 { return nil } return a }