From 9f0b143ce6826865336e682928e042c4480f473c Mon Sep 17 00:00:00 2001 From: yinheli Date: Mon, 12 Jul 2021 18:25:25 +0800 Subject: [PATCH] fix model saveAll method --- tools/xservice/model/mysql/table.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/xservice/model/mysql/table.go b/tools/xservice/model/mysql/table.go index 68a52c9..65bafdb 100644 --- a/tools/xservice/model/mysql/table.go +++ b/tools/xservice/model/mysql/table.go @@ -424,7 +424,7 @@ func (t *MySQLGenerator) tableDefaultModel(table *Table) *jen.Statement { // SaveAll c.Comment("SaveAll update all items in database, if the value doesn't have primary key, will insert it").Line() c.Func().Params(jen.Id("t").Op("*").Id(typeName)).Id("SaveAll").Params(jen.Id("data []*").Id(modelName)).Id("error").Block( - jen.Return(jen.Id("t.tx.Create(data).Error")), + jen.Return(jen.Id("t.tx.Save(data).Error")), ).Line() // Update