fix: loadpconf and get nbinfo
This commit is contained in:
1 parent
2223828b2b
commit
3a5e906222
4 files changed
+125
-7
No files matched your search
+13
-5
@@ -46,6 +46,14 @@ func XormInsertParamConfig(mapJson *map[string]interface{}) (int64, error) {
|
||||
}
|
||||
fmt.Printf("n: %s", n)
|
||||
|
||||
session := xEngine.NewSession()
|
||||
defer session.Close()
|
||||
_, err = session.Table("param_config").Where("ne_type = ?", strings.ToUpper(n)).Delete()
|
||||
if err != nil {
|
||||
fmt.Println("Failed to delete param_config:", err)
|
||||
}
|
||||
session.Commit()
|
||||
|
||||
for t, p := range d.(map[string]interface{}) {
|
||||
if p == nil {
|
||||
break
|
||||
@@ -77,17 +85,17 @@ func XormInsertParamConfig(mapJson *map[string]interface{}) (int64, error) {
|
||||
|
||||
session := xEngine.NewSession()
|
||||
defer session.Close()
|
||||
_, err = session.Table("param_config").Where("ne_type = ? and top_tag = ?", paramConfig.NeType, paramConfig.TopTag).Delete()
|
||||
if err != nil {
|
||||
fmt.Println("Failed to delete param_config:", err)
|
||||
}
|
||||
// _, err = session.Table("param_config").Where("ne_type = ? and top_tag = ?", paramConfig.NeType, paramConfig.TopTag).Delete()
|
||||
// if err != nil {
|
||||
// fmt.Println("Failed to delete param_config:", err)
|
||||
// }
|
||||
a, err = session.Insert(paramConfig)
|
||||
if err != nil {
|
||||
fmt.Println("Failed to insert param_config:", err)
|
||||
}
|
||||
session.Commit()
|
||||
affected += a
|
||||
}
|
||||
}
|
||||
|
||||
return affected, err
|
||||
}
|
||||
Reference in new issue
Block a user