- 修复GetAndStoreCitiesShops中存储最后一个商店出记录已经存在错出的bug
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user