|
|
@@ -0,0 +1,23 @@ |
|
|
|
package db |
|
|
|
|
|
|
|
import ( |
|
|
|
"code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models/official/model" |
|
|
|
"xorm.io/xorm" |
|
|
|
) |
|
|
|
|
|
|
|
func SysCfgByKey(eg *xorm.Engine, key string) *model.SysCfg { |
|
|
|
var data model.SysCfg |
|
|
|
get, err := eg.Where("k=?", key).Get(&data) |
|
|
|
if get == false || err != nil { |
|
|
|
return nil |
|
|
|
} |
|
|
|
return &data |
|
|
|
} |
|
|
|
func SysCfgByKeyStr(eg *xorm.Engine, key string) string { |
|
|
|
var data model.SysCfg |
|
|
|
get, err := eg.Where("k=?", key).Get(&data) |
|
|
|
if get == false || err != nil { |
|
|
|
return "" |
|
|
|
} |
|
|
|
return data.V |
|
|
|
} |