|
1234567891011121314151617181920212223242526 |
- package db
-
- import (
- "applet/app/db/model"
- "applet/app/utils/logx"
- "xorm.io/xorm"
- )
-
- //SysTmpFindByIsUseByType is find tmp by issystem
- func SysTmpFindByIsUseByType(Db *xorm.Engine, use, t, platform string) (*model.SysTemplate, error) {
- var m model.SysTemplate
- if has, err := Db.Where("is_use = ? AND type = ? AND platform = ?", use, t, platform).
- Get(&m); err != nil || has == false {
- return nil, logx.Warn(err)
- }
- return &m, nil
- }
-
- func SysTmpFindByID(Db *xorm.Engine, id int) (*model.SysTemplate, error) {
- var m model.SysTemplate
- if has, err := Db.Where("id = ?", id).
- Get(&m); err != nil || has == false {
- return nil, logx.Warn(err)
- }
- return &m, nil
- }
|