面包店
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.

db_sys_tmp.go 674 B

9 months ago
1234567891011121314151617181920212223242526
  1. package db
  2. import (
  3. "applet/app/db/model"
  4. "applet/app/utils/logx"
  5. "xorm.io/xorm"
  6. )
  7. //SysTmpFindByIsUseByType is find tmp by issystem
  8. func SysTmpFindByIsUseByType(Db *xorm.Engine, use, t, platform string) (*model.SysTemplate, error) {
  9. var m model.SysTemplate
  10. if has, err := Db.Where("is_use = ? AND type = ? AND platform = ?", use, t, platform).
  11. Get(&m); err != nil || has == false {
  12. return nil, logx.Warn(err)
  13. }
  14. return &m, nil
  15. }
  16. func SysTmpFindByID(Db *xorm.Engine, id int) (*model.SysTemplate, error) {
  17. var m model.SysTemplate
  18. if has, err := Db.Where("id = ?", id).
  19. Get(&m); err != nil || has == false {
  20. return nil, logx.Warn(err)
  21. }
  22. return &m, nil
  23. }