rdluck 4 жил өмнө
parent
commit
523c7b8c52
1 өөрчлөгдсөн 2 нэмэгдсэн , 1 устгасан
  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
 }