|
@@ -62,11 +62,16 @@ def update_one(collection: Collection, item):
|
|
def update_one_by_domain(collection: Collection, item):
|
|
def update_one_by_domain(collection: Collection, item):
|
|
lst = []
|
|
lst = []
|
|
res = collection.find_one({'domain': item['domain']})
|
|
res = collection.find_one({'domain': item['domain']})
|
|
- if res is not None and item['origin'] not in res['origin']:
|
|
|
|
- lst.append(item['origin']) # 添加挖掘新成员
|
|
|
|
- lst.extend(res['origin']) # 合并已收录旧成员
|
|
|
|
|
|
+ if res is not None:
|
|
|
|
+ item['update_at'] = item.pop('create_at')
|
|
|
|
+ if item['origin'] not in res['origin']:
|
|
|
|
+ lst.append(item['origin']) # 添加挖掘新成员
|
|
|
|
+ lst.extend(res['origin']) # 合并已收录旧成员
|
|
|
|
+ else:
|
|
|
|
+ lst = res['origin']
|
|
else:
|
|
else:
|
|
lst.append(item['origin'])
|
|
lst.append(item['origin'])
|
|
|
|
+ item['update_at'] = item['create_at']
|
|
|
|
|
|
item.update({'origin': lst})
|
|
item.update({'origin': lst})
|
|
collection.update_one(
|
|
collection.update_one(
|