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

22 line
386 B

  1. package db
  2. import (
  3. "applet/app/db/model"
  4. "errors"
  5. "xorm.io/xorm"
  6. )
  7. //SysPushTemplateByType is 根据类型
  8. func SysPushTemplateByType(Db *xorm.Engine, t string) (*model.SysPushTemplate, error) {
  9. m := new(model.SysPushTemplate)
  10. has, err := Db.Where("type = ?", t).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. }