update
This commit is contained in:
parent
048f9958dc
commit
b814161c5f
@ -207,9 +207,14 @@ class Summary3(Task):
|
||||
for doc in cursor:
|
||||
doc_date = doc['cdate']
|
||||
age_day = (cdate - doc_date) // 86400 + 1
|
||||
data = {f'{cat}_all_money_{age_day}': doc[f'{cat}_all_money_{age_day - 1}']}
|
||||
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})
|
||||
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.remote_db[f'summary_{cat}'].update_one({'_id': doc['_id']}, {'$set': data})
|
||||
|
||||
update('role')
|
||||
update('account')
|
||||
|
Loading…
Reference in New Issue
Block a user