mirror of
https://github.com/tobycroft/gorose-pro.git
synced 2025-09-26 20:51:27 +08:00
Fix/Change
- 修复db.Data需要手动添加""符号的问题 - 修改Data方法的Null处理,现在输入"nil"和空字符串都会让字段变成Null type,而不是原来的null的string type
This commit is contained in:
@@ -302,17 +302,17 @@ func (b *BuilderOracle) parseData(operType string, data []map[string]interface{}
|
||||
// 定义1条数据的存储
|
||||
var dataValuesSub []string
|
||||
for _, key := range dataFields {
|
||||
if item[key] == nil {
|
||||
// 放入占位符
|
||||
dataValuesSub = append(dataValuesSub, b.GetPlaceholder())
|
||||
// 保存真正的值为null
|
||||
b.IOrm.SetBindValues("null")
|
||||
} else {
|
||||
//if item[key] == nil {
|
||||
// // 放入占位符
|
||||
// dataValuesSub = append(dataValuesSub, b.GetPlaceholder())
|
||||
// // 保存真正的值为null
|
||||
// b.IOrm.SetBindValues("null")
|
||||
//} else {
|
||||
// 放入占位符
|
||||
dataValuesSub = append(dataValuesSub, b.GetPlaceholder())
|
||||
// 保存真正的值
|
||||
b.IOrm.SetBindValues(item[key])
|
||||
}
|
||||
//}
|
||||
// update
|
||||
dataObj = append(dataObj, fmt.Sprintf("%s=%s", b.AddFieldQuotesOracle(key), b.GetPlaceholder()))
|
||||
}
|
||||
|
Reference in New Issue
Block a user