面包店
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 
 
 
 

27 rindas
674 B

  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. }