diff --git a/dags/business/business/didata_sync.py b/dags/business/business/didata_sync.py index 190d6dd..d8b8b14 100644 --- a/dags/business/business/didata_sync.py +++ b/dags/business/business/didata_sync.py @@ -26,8 +26,10 @@ def sync_district_office(type): for doc in seaweed_conn.find({'city': city, 'cat': type, 'status': 0}, {'city': 1, 'region': 1, 'block': 1, 'cat': 1, 'name': 1, 'address': 1, 'estate_type2': 1, 'township': 1, 'alias': 1, 'addr_alias': 1, 'lng': 1, 'lat': 1, 'status': 1})\ .batch_size(10000): - updateDict = {'city': doc['city'], 'region': doc['region'], 'category': doc['cat'], 'name': doc['name'], - 'estate_type': doc['estate_type2'], 'status': doc['status']} + updateDict = {'city': doc['city'], 'region': doc['region'], 'category': doc['cat'], 'name': doc['name'], 'status': doc['status']} + if 'estate_type2' in doc: + updateDict['estate_type'] = doc['estate_type2'] + id_list.append({'_id': doc['_id']}) if 'block' in doc: updateDict['block'] = doc['block']