update
This commit is contained in:
parent
048f9958dc
commit
b814161c5f
@ -207,7 +207,12 @@ class Summary3(Task):
|
|||||||
for doc in cursor:
|
for doc in cursor:
|
||||||
doc_date = doc['cdate']
|
doc_date = doc['cdate']
|
||||||
age_day = (cdate - doc_date) // 86400 + 1
|
age_day = (cdate - doc_date) // 86400 + 1
|
||||||
data = {f'{cat}_all_money_{age_day}': doc[f'{cat}_all_money_{age_day - 1}']}
|
try:
|
||||||
|
age_idx = RETAIN_DAYS.index(age_day)
|
||||||
|
except ValueError:
|
||||||
|
continue
|
||||||
|
else:
|
||||||
|
data = {f'{cat}_all_money_{age_day}': doc[f'{cat}_all_money_{RETAIN_DAYS[age_idx - 1]}']}
|
||||||
self.local_db[f'summary_{cat}'].update_one({'_id': doc['_id']}, {'$set': data})
|
self.local_db[f'summary_{cat}'].update_one({'_id': doc['_id']}, {'$set': data})
|
||||||
self.remote_db[f'summary_{cat}'].update_one({'_id': doc['_id']}, {'$set': data})
|
self.remote_db[f'summary_{cat}'].update_one({'_id': doc['_id']}, {'$set': data})
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user