package services import ( "github.com/jinzhu/gorm" "lzyd-user-api/models" ) // 获取系统字典 func GetSystemDict(db *gorm.DB) models.SystemDict { var dict models.SystemDict sql := "SELECT `name`, `value`, `type` FROM system_dict WHERE deleted_at IS NULL" db.Raw(sql).Find(&dict) return dict } // 获取版本信息 func GetVersionInfo(db *gorm.DB, client int) models.VersionInfo { var versionInfo models.VersionInfo sql := "SELECT number, download_url, content, force_update, client FROM version_info WHERE client = ? AND delete_at IS NULL" db.Raw(sql, client).Find(&versionInfo) return versionInfo }