- 修复GetAndStoreCitiesShops中存储最后一个商店出记录已经存在错出的bug
This commit is contained in:
@@ -198,12 +198,17 @@ func GetAndStoreCitiesShops(ctx *jxcontext.Context, vendorIDs []int, cityCodeLis
|
|||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
for _, v := range shopList {
|
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 {
|
if v.DistrictCode > 0 {
|
||||||
tmpShop := *v
|
tmpShop := *v
|
||||||
dao.DeleteEntity(db, &tmpShop, model.FieldVendorStoreID, model.FieldVendorID)
|
dao.DeleteEntity(db, &tmpShop, model.FieldVendorStoreID, model.FieldVendorID)
|
||||||
}
|
}
|
||||||
if err = dao.CreateEntity(db, v); err != nil && !dao.IsDuplicateError(err) {
|
if err = dao.CreateEntity(db, v); err != nil {
|
||||||
break
|
if dao.IsDuplicateError(err) {
|
||||||
|
err = nil
|
||||||
|
} else {
|
||||||
|
break
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user