This commit is contained in:
邹宗楠
2024-01-18 11:30:15 +08:00
parent 6562bcaf8e
commit fca7283d9b

View File

@@ -6403,24 +6403,19 @@ func BatchGetMTStoreLogos(vendorOrgCode string, mtStoreIDs []string) (storeLogos
//批量更新美团门店logos
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 {
if len(v.PicUrl) == 0 && len(v.Address) == 0 {
return "暂无需要更新数据"
}
param := map[string]interface{}{}
if len(v.PicUrl) > 0 {
param["pic_url"] = v.PicUrl
}
if len(v.Address) > 0 {
param["address"] = v.Address
}
storeDetail, err1 := dao.GetStoreDetailForDD(dao.GetDB(), 0, model.VendorIDMTWM, v.PoiCode, "")
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 {
apiObj := mtwm.GetAPI(vendorOrgCode, 0, v.PoiCode)
if err := apiObj.PoiSave(v.PoiCode, param); err != nil {
hint += fmt.Sprintf("%s:%v\n", v.PoiCode, err)
}
}