- 修复GetAndStoreCitiesShops中存储最后一个商店出记录已经存在错出的bug

This commit is contained in:
gazebo
2019-09-13 16:14:49 +08:00
parent 5eadabd0d8
commit 5fdbf3a1e1

View File

@@ -198,12 +198,17 @@ func GetAndStoreCitiesShops(ctx *jxcontext.Context, vendorIDs []int, cityCodeLis
}
}()
for _, v := range shopList {
globals.SugarLogger.Debugf("GetAndStoreCitiesShops cityCode:%d, 平台:%s, shopID:%s, districtCode:%d", cityCode, model.VendorChineseNames[v.VendorID], v.VendorStoreID, v.DistrictCode)
if v.DistrictCode > 0 {
tmpShop := *v
dao.DeleteEntity(db, &tmpShop, model.FieldVendorStoreID, model.FieldVendorID)
}
if err = dao.CreateEntity(db, v); err != nil && !dao.IsDuplicateError(err) {
break
if err = dao.CreateEntity(db, v); err != nil {
if dao.IsDuplicateError(err) {
err = nil
} else {
break
}
}
}
if err != nil {