This commit is contained in:
suyl
2021-05-24 15:25:08 +08:00
parent d986be7cad
commit c1908dcd8f
5 changed files with 98 additions and 0 deletions

View File

@@ -79,6 +79,13 @@ var (
// return ebaiUploadRTFShopID
// }
func GetVendorCategoriesWithMap(ctx *jxcontext.Context, vendorID int) (vendorCats []*dao.GetVendorCategoriesWithMapResult, err error) {
if vendorID != model.VendorIDMTWM {
return nil, fmt.Errorf("只支持美团!")
}
return dao.GetVendorCategoriesWithMap(dao.GetDB(), vendorID)
}
// parentID 为-1表示所有
func GetVendorCategories(ctx *jxcontext.Context, vendorID int, parentID string) (vendorCats []*model.SkuVendorCategory, err error) {
cond := map[string]interface{}{

View File

@@ -5734,3 +5734,29 @@ func CopyMtToJd(ctx *jxcontext.Context, mtStoreID, mtOrgCode, jdStoreID, jdOrgCo
task.GetResult(0)
return err
}
func UpdateMtCatToJd(ctx *jxcontext.Context, mtCatID, jdCatID string) (err error) {
var (
db = dao.GetDB()
)
list, _ := dao.GetMtJdCategoryMap(db, mtCatID, jdCatID)
if len(list) > 0 {
return
}
list2, _ := dao.GetMtJdCategoryMap(db, mtCatID, "")
if len(list2) > 0 {
if list2[0].JdID == jdCatID {
return
} else {
list2[0].JdID = jdCatID
dao.UpdateEntity(db, list2[0], "JdID")
}
} else {
catMap := &model.MtJdCategoryMap{
MtID: mtCatID,
JdID: jdCatID,
}
dao.CreateEntity(db, catMap)
}
return err
}