Explorar el Código

新增基础操作

rdluck hace 4 años
padre
commit
523c7b8c52
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. 2 1
      models/db_base.go

+ 2 - 1
models/db_base.go

@@ -50,7 +50,8 @@ func DeleteByExpr(ptrStructOrTableName interface{}, where map[string]interface{}
 }
 
 // 插入
-func InsertData(o orm.Ormer, ptrStructOrTableName interface{}) error {
+func InsertData(ptrStructOrTableName interface{}) error {
+	o := orm.NewOrm()
 	_, err := o.Insert(ptrStructOrTableName)
 	return err
 }