- 将Dao.DB中db改为Db

This commit is contained in:
gazebo
2019-04-16 16:14:08 +08:00
parent fc5cb88d8b
commit 844cc70c1e
3 changed files with 23 additions and 21 deletions

View File

@@ -22,7 +22,7 @@ func GetEntitiesByKV(db *DaoDB, item interface{}, conditions map[string]interfac
if typeInfo.Kind() == reflect.Ptr {
typeInfo = typeInfo.Elem()
}
qs := db.db.QueryTable(reflect.New(typeInfo).Interface())
qs := db.Db.QueryTable(reflect.New(typeInfo).Interface())
for k, v := range conditions {
qs = qs.Filter(k, v)
}
@@ -42,7 +42,7 @@ func UpdateEntityByKV(db *DaoDB, item interface{}, kvs map[string]interface{}, c
if db == nil {
db = GetDB()
}
qs := db.db.QueryTable(item)
qs := db.Db.QueryTable(item)
if conditions == nil {
qs = qs.Filter(model.FieldID, refutil.GetObjFieldByName(item, model.FieldID))
} else {