InitVendorCategory中改用批量插入

This commit is contained in:
gazebo
2019-11-20 09:41:00 +08:00
parent 61570289a2
commit ea49b20528
2 changed files with 4 additions and 4 deletions

View File

@@ -275,9 +275,9 @@ func InitVendorCategory(ctx *jxcontext.Context, vendorID int, isAsync bool) (hin
}
for _, cat := range cats {
dao.WrapAddIDCULEntity(cat, ctx.GetUserName())
if err = dao.CreateEntity(db, cat); err != nil {
return nil, err
}
}
if err = dao.CreateMultiEntities(db, cats); err != nil {
return nil, err
}
dao.Commit(db)
}