相关条件的统计
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.

пре 1 година
123456789101112131415161718192021222324
  1. package db
  2. import (
  3. "code.fnuoos.com/go_rely_warehouse/zyos_go_condition_statistics.git/db/model"
  4. "xorm.io/xorm"
  5. )
  6. // 系统配置get
  7. func SysCfgGetAll(Db *xorm.Engine) (*[]model.SysCfg, error) {
  8. var cfgList []model.SysCfg
  9. if err := Db.Cols("key,val,memo").Find(&cfgList); err != nil {
  10. return nil, err
  11. }
  12. return &cfgList, nil
  13. }
  14. // 获取一条记录
  15. func SysCfgGetOne(Db *xorm.Engine, key string) (*model.SysCfg, error) {
  16. var cfgList model.SysCfg
  17. if has, err := Db.Where("`key`=?", key).Get(&cfgList); err != nil || has == false {
  18. return nil, err
  19. }
  20. return &cfgList, nil
  21. }