1
This commit is contained in:
@@ -6403,24 +6403,19 @@ func BatchGetMTStoreLogos(vendorOrgCode string, mtStoreIDs []string) (storeLogos
|
|||||||
|
|
||||||
//批量更新美团门店logos
|
//批量更新美团门店logos
|
||||||
func BatchUpdateMTStoreLogos(vendorOrgCode string, relInfo []MtRelInfo) (hint string) {
|
func BatchUpdateMTStoreLogos(vendorOrgCode string, relInfo []MtRelInfo) (hint string) {
|
||||||
|
param := map[string]interface{}{}
|
||||||
|
if len(relInfo[0].PicUrl) > 0 {
|
||||||
|
param["pic_url"] = relInfo[0].PicUrl
|
||||||
|
}
|
||||||
for _, v := range relInfo {
|
for _, v := range relInfo {
|
||||||
if len(v.PicUrl) == 0 && len(v.Address) == 0 {
|
if len(v.PicUrl) == 0 && len(v.Address) == 0 {
|
||||||
return "暂无需要更新数据"
|
return "暂无需要更新数据"
|
||||||
}
|
}
|
||||||
param := map[string]interface{}{}
|
|
||||||
if len(v.PicUrl) > 0 {
|
|
||||||
param["pic_url"] = v.PicUrl
|
|
||||||
}
|
|
||||||
if len(v.Address) > 0 {
|
if len(v.Address) > 0 {
|
||||||
param["address"] = v.Address
|
param["address"] = v.Address
|
||||||
}
|
}
|
||||||
|
apiObj := mtwm.GetAPI(vendorOrgCode, 0, v.PoiCode)
|
||||||
storeDetail, err1 := dao.GetStoreDetailForDD(dao.GetDB(), 0, model.VendorIDMTWM, v.PoiCode, "")
|
if err := apiObj.PoiSave(v.PoiCode, param); err != nil {
|
||||||
if err1 != nil {
|
|
||||||
hint += fmt.Sprintf("%s:%v\n", v.PoiCode, err1)
|
|
||||||
}
|
|
||||||
globals.SugarLogger.Debugf("BatchUpdateMTStoreLogos param=%s", utils.Format4Output(param, false))
|
|
||||||
if err := mtwm.GetAPI(vendorOrgCode, storeDetail.Store.ID, "").PoiSave(v.PoiCode, param); err != nil {
|
|
||||||
hint += fmt.Sprintf("%s:%v\n", v.PoiCode, err)
|
hint += fmt.Sprintf("%s:%v\n", v.PoiCode, err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user