- beta启动时自动运行netspider.GetAndStoreCitiesShops
This commit is contained in:
@@ -192,9 +192,11 @@ func GetAndStoreCitiesShops(ctx *jxcontext.Context, vendorIDs []int, cityCodeLis
|
||||
}
|
||||
}()
|
||||
for _, v := range shopList {
|
||||
tmpShop := *v
|
||||
dao.DeleteEntity(db, &tmpShop, model.FieldVendorStoreID, model.FieldVendorID)
|
||||
if err = dao.CreateEntity(db, v); err != nil {
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user