1
This commit is contained in:
@@ -6560,9 +6560,24 @@ func CopyMtToJd(ctx *jxcontext.Context, mtStoreID, mtOrgCode, jdStoreID, jdOrgCo
|
|||||||
handler, _ = partner.GetPurchasePlatformFromVendorID(model.VendorIDJD).(partner.IPurchasePlatformStoreSkuHandler)
|
handler, _ = partner.GetPurchasePlatformFromVendorID(model.VendorIDJD).(partner.IPurchasePlatformStoreSkuHandler)
|
||||||
)
|
)
|
||||||
|
|
||||||
jd := jd.GetAPI(jdOrgCode)
|
codes, _ := dao.GetVendorOrgCode(dao.GetDB(), model.VendorIDJD, jdOrgCode, "platform")
|
||||||
|
if len(codes) == 0 {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
code := codes[0]
|
||||||
|
jd := jdapi.New(code.Token, code.AppKey, code.AppSecret)
|
||||||
//获取token
|
//获取token
|
||||||
mtapi := apimanager.CurAPIManager.GetAPI(model.VendorIDMTWM, mtOrgCode).(*mtwmapi.API)
|
mtStore, err := dao.GetStoreDetailByVendorStoreID(dao.GetDB(), mtStoreID, model.VendorIDMTWM, mtOrgCode)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
var mtapi *mtwmapi.API
|
||||||
|
if mtStore.VendorOrgCode == globals.Mtwm2Code {
|
||||||
|
mtapi = mtwmapi.New(beego.AppConfig.DefaultString("mtwmAppID2", ""), beego.AppConfig.DefaultString("mtwmSecret2", ""), beego.AppConfig.DefaultString("mtwmCallbackURL2", ""), "")
|
||||||
|
mtapi.SetToken(mtStore.MtwmToken)
|
||||||
|
} else {
|
||||||
|
mtapi = partner.CurAPIManager.GetAPI(model.VendorIDMTWM, mtOrgCode).(*mtwmapi.API)
|
||||||
|
}
|
||||||
//LoopCatChild = func(mtID, parentID string, catInfo []*mtwmapi.RetailCategoryInfo) {
|
//LoopCatChild = func(mtID, parentID string, catInfo []*mtwmapi.RetailCategoryInfo) {
|
||||||
// if len(catInfo) > 0 {
|
// if len(catInfo) > 0 {
|
||||||
// for j := len(catInfo) - 1; j > -1; j-- {
|
// for j := len(catInfo) - 1; j > -1; j-- {
|
||||||
|
|||||||
Reference in New Issue
Block a user