diff --git a/tools/xservice/model/mysql/table.go b/tools/xservice/model/mysql/table.go index 4770b20..66c073f 100644 --- a/tools/xservice/model/mysql/table.go +++ b/tools/xservice/model/mysql/table.go @@ -493,7 +493,7 @@ func (t *MySQLGenerator) tableDefaultModel(table *Table) *jen.Statement { jen.Id("var data ").Id(modelName), jen.Id("err := t.tx.First(&data, conds...).Error"), jen.If(jen.Id("err != nil &&").Qual("errors", "Is(err, gorm.ErrRecordNotFound)")).Block( - jen.Return(jen.Id("nil, err")), + jen.Return(jen.Id("nil, nil")), ), jen.Return(jen.Id("&data, err")), ).Line()