美团饿百打包费改为统一系统参数

This commit is contained in:
gazebo
2019-12-30 18:07:26 +08:00
parent f1d025eb15
commit 3ee2e72a5e
9 changed files with 40 additions and 12 deletions

View File

@@ -49,3 +49,13 @@ func ValidateRoles(db *DaoDB, roles ...string) (err error) {
}
return errList.GetErrListAsOne()
}
func GetSysConfigAsInt64(db *DaoDB, key string) (value int64, err error) {
configList, err := QueryConfigs(db, key, model.ConfigTypeSys, "")
if err == nil && len(configList) > 0 {
value = utils.Str2Int64WithDefault(configList[0].Value, 0)
} else if IsNoRowsError(err) {
err = nil
}
return value, err
}