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 { for _, cat := range cats {
dao.WrapAddIDCULEntity(cat, ctx.GetUserName()) 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) dao.Commit(db)
} }

View File

@@ -39,7 +39,7 @@ func (c *InitDataController) InitSkuName() {
} }
// @Title 初始化vendor category // @Title 初始化vendor category
// @Description 初始化vendor category(当前只有美团外卖的通过这个设置) // @Description 初始化vendor category
// @Param token header string true "认证token" // @Param token header string true "认证token"
// @Param vendorID formData int true "厂商ID" // @Param vendorID formData int true "厂商ID"
// @Param isAsync formData bool false "是否异步操作" // @Param isAsync formData bool false "是否异步操作"