launch.go 617 B

12345678910111213141516171819202122
  1. package services
  2. import (
  3. "github.com/jinzhu/gorm"
  4. "lzyd-user-api/models"
  5. )
  6. // 获取系统字典
  7. func GetSystemDict(db *gorm.DB) models.SystemDict {
  8. var dict models.SystemDict
  9. sql := "SELECT `name`, `value`, `type` FROM system_dict WHERE deleted_at IS NULL"
  10. db.Raw(sql).Find(&dict)
  11. return dict
  12. }
  13. // 获取版本信息
  14. func GetVersionInfo(db *gorm.DB, client int) models.VersionInfo {
  15. var versionInfo models.VersionInfo
  16. sql := "SELECT number, download_url, content, force_update, client FROM version_info WHERE client = ? AND delete_at IS NULL"
  17. db.Raw(sql, client).Find(&versionInfo)
  18. return versionInfo
  19. }