package db import ( "code.fnuoos.com/go_rely_warehouse/zyos_go_condition_statistics.git/db/model" "xorm.io/xorm" ) // 系统配置get func SysCfgGetAll(Db *xorm.Engine) (*[]model.SysCfg, error) { var cfgList []model.SysCfg if err := Db.Cols("key,val,memo").Find(&cfgList); err != nil { return nil, err } return &cfgList, nil } // 获取一条记录 func SysCfgGetOne(Db *xorm.Engine, key string) (*model.SysCfg, error) { var cfgList model.SysCfg if has, err := Db.Where("`key`=?", key).Get(&cfgList); err != nil || has == false { return nil, err } return &cfgList, nil }