新增m_date周边

This commit is contained in:
沈健
2025-03-11 17:46:19 +08:00
parent 0fa69ae9c0
commit bb217cc4c3
6 changed files with 19 additions and 13 deletions
+3 -2
View File
@@ -6,6 +6,7 @@ from goojia_utils import MAIN_MONGO_CLIENT, ElasticSearchClient, process_datafra
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):
action = UpdateOne({'city': item['city'], 'region': item['region'],
'district_name': item['name']},
{'$set': {'subway': item['subway'], 'city': item['city'], 'region': item['region'],
'district_name': item['name'], 'lng': item['lng'], 'lat': item['lat'],
'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:
@@ -98,7 +99,7 @@ def sync1():
action = UpdateOne({'city': item['city'], 'region': item['region'],
'district_name': item['name']},
{'$set': {'subway': item['subway'], 'city': item['city'], 'region': item['region'],
'district_name': item['name'], 'lng': item['lng'], 'lat': item['lat']}},
'district_name': item['name'], 'lng': item['lng'], 'lat': item['lat'], 'm_date': datetime.now()}},
upsert=True)
actions.append(action)
except Exception as e: