新增m_date周边
This commit is contained in:
@@ -6,6 +6,7 @@ from goojia_utils import MAIN_MONGO_CLIENT, process_dataframe_multithread
|
||||
import pandas as pd
|
||||
from pymongo import UpdateOne
|
||||
import poiutils
|
||||
from datetime import datetime
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
@@ -60,7 +61,7 @@ def sync_new(distance=3000):
|
||||
# 周边配套库中历史原因,id可能不为小区id
|
||||
action = UpdateOne({'city': item['city'], 'region': item['region'],
|
||||
'district_name': item['name']}, {'$set': {'school': item['school'], 'city': item['city'], 'region': item['region'],
|
||||
'district_name': item['name'], 'lng': item['lng'], 'lat': item['lat'], 'distance': distance}}, upsert=True)
|
||||
'district_name': item['name'], 'lng': item['lng'], 'lat': item['lat'], 'm_date': datetime.now(), 'distance': distance}}, upsert=True)
|
||||
actions.append(action)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
@@ -93,7 +94,7 @@ def sync1():
|
||||
# 周边配套库中历史原因,id可能不为小区id
|
||||
action = UpdateOne({'city': item['city'], 'region': item['region'],
|
||||
'district_name': item['name']}, {'$set': {'school': item['school'], 'city': item['city'], 'region': item['region'],
|
||||
'district_name': item['name'], 'lng': item['lng'], 'lat': item['lat']}}, upsert=True)
|
||||
'district_name': item['name'], 'lng': item['lng'], 'lat': item['lat'], 'm_date': datetime.now()}}, upsert=True)
|
||||
actions.append(action)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
||||
Reference in New Issue
Block a user