- user man and user store bind.

This commit is contained in:
gazebo
2018-09-12 15:18:56 +08:00
parent 05bd085116
commit 0fd377e0d3
6 changed files with 264 additions and 6 deletions

View File

@@ -187,3 +187,17 @@ func DeleteEntity(db *DaoDB, item interface{}, conditions map[string]interface{}
}, reflect.TypeOf(item).Name())
return num, err
}
func UpdateBySQL(db *DaoDB, sql string, params ...interface{}) (num int64, err error) {
if db == nil {
db = GetDB()
}
err = utils.CallFuncLogError(func() error {
result, err2 := db.db.Raw(sql, params...).Exec()
if err2 == nil {
num, _ = result.RowsAffected()
}
return err2
}, sql)
return num, err
}