面包店
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

41 regels
916 B

  1. package db
  2. import (
  3. "applet/app/db/model"
  4. "errors"
  5. "xorm.io/xorm"
  6. )
  7. // GetCloudBundleByVersion is 根据版本 获取打包记录
  8. func GetCloudBundleByVersion(Db *xorm.Engine, appverison string, os int) (*model.CloudBundle, error) {
  9. m := new(model.CloudBundle)
  10. has, err := Db.Where("version = ? and os = ?", appverison, os).Get(m)
  11. if err != nil {
  12. return nil, err
  13. }
  14. if !has {
  15. return nil, errors.New("not Found")
  16. }
  17. return m, nil
  18. }
  19. // GetCloudBundleByVersionPlatform is 根据版本\os 获取打包记录
  20. func GetCloudBundleByVersionPlatform(Db *xorm.Engine, appverison string, platform string) (*model.CloudBundle, error) {
  21. m := new(model.CloudBundle)
  22. var tag int
  23. if platform == "ios" {
  24. tag = 2
  25. } else {
  26. tag = 1
  27. }
  28. has, err := Db.Where("version = ? and os=?", appverison, tag).Get(m)
  29. if err != nil {
  30. return nil, err
  31. }
  32. if !has {
  33. return nil, errors.New("not Found")
  34. }
  35. return m, nil
  36. }