根据名字查询京东门店等级修改
This commit is contained in:
@@ -755,12 +755,11 @@ func (a *API) IsJdManagerUser(id int64) (isManager bool, err error) {
|
|||||||
// 查询京东门店等级
|
// 查询京东门店等级
|
||||||
// 无法得到总数,循环50页后放弃寻找。。
|
// 无法得到总数,循环50页后放弃寻找。。
|
||||||
// https://sta-store.jddj.com/store/logquery?venderId=320406&stationNo=11733018¤tPage=1&pageSize=20
|
// https://sta-store.jddj.com/store/logquery?venderId=320406&stationNo=11733018¤tPage=1&pageSize=20
|
||||||
func (a *API) GetJdStoreLevel(vendorOrgCode, vendorStoreID string) (level string, err error) {
|
func (a *API) GetJdStoreLevel(vendorOrgCode, vendorStoreID string, currentPage int) (level string, err error) {
|
||||||
for i := 1; i < 51; i++ {
|
|
||||||
jdParams := map[string]interface{}{
|
jdParams := map[string]interface{}{
|
||||||
"venderId": vendorOrgCode,
|
"venderId": vendorOrgCode,
|
||||||
"stationNo": vendorStoreID,
|
"stationNo": vendorStoreID,
|
||||||
"currentPage": i,
|
"currentPage": currentPage,
|
||||||
"pageSize": 20,
|
"pageSize": 20,
|
||||||
}
|
}
|
||||||
body, err := a.AccessStorePage2("https://sta-store.jddj.com/store/logquery", jdParams, false, "")
|
body, err := a.AccessStorePage2("https://sta-store.jddj.com/store/logquery", jdParams, false, "")
|
||||||
@@ -772,10 +771,6 @@ func (a *API) GetJdStoreLevel(vendorOrgCode, vendorStoreID string) (level string
|
|||||||
if len(levelList) > 0 {
|
if len(levelList) > 0 {
|
||||||
level = levelList[0][1]
|
level = levelList[0][1]
|
||||||
}
|
}
|
||||||
if level != "" {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return level, err
|
return level, err
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -808,9 +803,8 @@ func (a *API) GetJdUpcCodeByName(name, upcCode string, pageNo, pageSize int) (pr
|
|||||||
}
|
}
|
||||||
productInfo := &ProductInfo{
|
productInfo := &ProductInfo{
|
||||||
OriginalName: v.(map[string]interface{})["name"].(string),
|
OriginalName: v.(map[string]interface{})["name"].(string),
|
||||||
Name: v.(map[string]interface{})["name"].(string),
|
|
||||||
UpcCode: v.(map[string]interface{})["upcCode"].(string),
|
UpcCode: v.(map[string]interface{})["upcCode"].(string),
|
||||||
Weight: float32(utils.Interface2Float64WithDefault(v.(map[string]interface{})["weight"], 0)),
|
Weight: float32(utils.Interface2Float64WithDefault(v.(map[string]interface{})["weight"], 0) * 1000),
|
||||||
ImgList: ImgList,
|
ImgList: ImgList,
|
||||||
}
|
}
|
||||||
productInfos = append(productInfos, productInfo)
|
productInfos = append(productInfos, productInfo)
|
||||||
|
|||||||
Reference in New Issue
Block a user