|
- package db
-
- import (
- "applet/app/db/model"
- "errors"
-
- "xorm.io/xorm"
- )
-
- //SysPushTemplateByType is 根据类型
- func SysPushTemplateByType(Db *xorm.Engine, t string) (*model.SysPushTemplate, error) {
- m := new(model.SysPushTemplate)
- has, err := Db.Where("type = ?", t).Get(m)
- if err != nil {
- return nil, err
- }
- if !has {
- return nil, errors.New("Not Found")
- }
- return m, nil
- }
|