- check sku status in GetStoreSkus.
- ebai UpdateStore almost ok.
This commit is contained in:
@@ -101,7 +101,6 @@ func (p *PurchaseHandler) UpdateStore(storeID int, userName string) (err error)
|
||||
"baidu_shop_id": store.VendorStoreID,
|
||||
"name": jxutils.ComposeStoreName(store.Name, partner.StoreNameSeparator, VendorStorePrefix),
|
||||
"phone": store.Tel1,
|
||||
"ivr_phone": store.Tel2,
|
||||
"longitude": jxutils.IntCoordinate2Standard(store.Lng),
|
||||
"latitude": jxutils.IntCoordinate2Standard(store.Lat),
|
||||
"address": store.Address,
|
||||
@@ -109,7 +108,10 @@ func (p *PurchaseHandler) UpdateStore(storeID int, userName string) (err error)
|
||||
"delivery_region": JxDeliveryRegion2Ebai(&store.Store),
|
||||
"business_time": JxBusinessTime2Ebai(&store.Store),
|
||||
}
|
||||
globals.SugarLogger.Debug(utils.Format4Output(params, false))
|
||||
if store.Tel2 != "" {
|
||||
params["ivr_phone"] = store.Tel2
|
||||
}
|
||||
// globals.SugarLogger.Debug(utils.Format4Output(params, false))
|
||||
if globals.EnableStoreWrite {
|
||||
if err = api.EbaiAPI.ShopUpdate(params); err == nil {
|
||||
shopID := 0
|
||||
@@ -176,12 +178,14 @@ func JxDeliveryRegion2Ebai(store *model.Store) interface{} {
|
||||
}
|
||||
deliveryRegion := []interface{}{
|
||||
map[string]interface{}{
|
||||
"name": store.Address + "配送区",
|
||||
"name": "主要配送区",
|
||||
"delivery_fee": 600,
|
||||
"delivery_time": "60",
|
||||
"min_buy_free": "0",
|
||||
"min_order_price": "0",
|
||||
"region": region,
|
||||
"region": []interface{}{
|
||||
region,
|
||||
},
|
||||
},
|
||||
}
|
||||
return deliveryRegion
|
||||
|
||||
@@ -15,7 +15,7 @@ func TestReadStore(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestUpdateStore(t *testing.T) {
|
||||
err := new(PurchaseHandler).UpdateStore(100002, "autotest")
|
||||
err := new(PurchaseHandler).UpdateStore(100077, "autotest")
|
||||
if err != nil {
|
||||
t.Fatal(err.Error())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user