InitVendorCategory中改用批量插入
This commit is contained in:
@@ -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)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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 "是否异步操作"
|
||||||
|
|||||||
Reference in New Issue
Block a user